Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating rakefile to use jeweler instead of newgem

  • Loading branch information...
commit bd6b5d3a5a4f3da450003d8430035d6f9b544612 1 parent 61da414
@schmidt authored
View
6 History.txt
@@ -1,3 +1,9 @@
+== 1.0.3 2009-12-03
+
+* minor changes
+ * updated to jeweler
+ * releasing on gemcutter
+
== 1.0.2 2008-04-01
* 1 major change
View
44 Manifest.txt
@@ -1,44 +0,0 @@
-GPL.txt
-History.txt
-LICENSE.txt
-MIT.txt
-Manifest.txt
-README.txt
-RUBY.txt
-Rakefile
-examples/README
-examples/employer.rb
-examples/node.rb
-lib/contextr.rb
-lib/contextr/class_methods.rb
-lib/contextr/core_ext.rb
-lib/contextr/core_ext/module.rb
-lib/contextr/core_ext/object.rb
-lib/contextr/event_machine.rb
-lib/contextr/inner_class.rb
-lib/contextr/layer.rb
-lib/contextr/modules/mutex_code.rb
-lib/contextr/modules/unique_id.rb
-lib/contextr/public_api.rb
-lib/contextr/version.rb
-lib/ext/active_support_subset.rb
-lib/ext/dynamic.rb
-scripts/txt2html
-setup.rb
-spec/contextr_spec.rb
-spec/spec.opts
-spec/spec_helper.rb
-test/class_side.mkd
-test/dynamic_scope.mkd
-test/dynamics.mkd
-test/hello_world.mkd
-test/introduction.mkd
-test/layer_state.mkd
-test/lib/example_test.rb
-test/lib/literate_maruku_test.rb
-test/meta_api.mkd
-test/method_missing.mkd
-test/ordering.mkd
-test/restrictions.mkd
-test/test_contextr.rb
-test/test_helper.rb
View
0  README.txt → README.rdoc
File renamed without changes
View
159 Rakefile
@@ -1,136 +1,53 @@
-require 'rubygems'
require 'rake'
-require 'rake/clean'
-require 'rake/testtask'
-require 'rake/packagetask'
-require 'rake/gempackagetask'
require 'rake/rdoctask'
-require 'rake/contrib/rubyforgepublisher'
-require 'fileutils'
-require 'hoe'
-begin
- require 'spec/rake/spectask'
-rescue LoadError
- puts 'To use rspec for testing you must install rspec gem:'
- puts '$ sudo gem install rspec'
- exit
-end
-include FileUtils
-require File.join(File.dirname(__FILE__), 'lib', 'contextr', 'version')
-
-AUTHOR = 'Gregor Schmidt' # can also be an array of Authors
-EMAIL = "ruby@schmidtwisser.de"
-DESCRIPTION = "The goal is to equip Ruby with an API to allow context-oriented programming."
-GEM_NAME = 'contextr' # what ppl will type to install your gem
-
-@config_file = "~/.rubyforge/user-config.yml"
-@config = nil
-def rubyforge_username
- unless @config
- begin
- @config = YAML.load(File.read(File.expand_path(@config_file)))
- rescue
- puts <<-EOS
-ERROR: No rubyforge config file found: #{@config_file}"
-Run 'rubyforge setup' to prepare your env for access to Rubyforge
- - See http://newgem.rubyforge.org/rubyforge.html for more details
- EOS
- exit
- end
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "contextr"
+ gemspec.summary = "Context-oriented programming API for Ruby"
+ gemspec.description = "The goal is to equip Ruby with an API to allow " +
+ "context-oriented programming."
+ gemspec.email = "ruby@schmidtwisser.de"
+ gemspec.homepage = "http://github.com/schmidt/contextr"
+ gemspec.authors = ["Gregor Schmidt"]
+
+ gemspec.add_development_dependency('rake')
+ gemspec.add_development_dependency('markaby')
+ gemspec.add_development_dependency('literate_maruku')
+ gemspec.add_development_dependency('rspec')
+ gemspec.add_development_dependency('jeweler', '>= 1.4.0')
end
- @rubyforge_username ||= @config["username"]
-end
-
-RUBYFORGE_PROJECT = 'contextr' # The unix name for your project
-HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
-DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
-
-NAME = "contextr"
-REV = nil
-# UNCOMMENT IF REQUIRED:
-# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
-VERS = ContextR::VERSION::STRING + (REV ? ".#{REV}" : "")
-CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
-RDOC_OPTS = ['--quiet', '--title', 'contextr documentation',
- "--opname", "index.html",
- "--line-numbers",
- "--main", "README",
- "--inline-source"]
-class Hoe
- def extra_deps
- @extra_deps.reject { |x| Array(x).first == 'hoe' }
- end
-end
-
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-hoe = Hoe.new(GEM_NAME, VERS) do |p|
- p.author = AUTHOR
- p.description = DESCRIPTION
- p.email = EMAIL
- p.summary = DESCRIPTION
- p.url = HOMEPATH
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
- p.test_globs = ["test/**/test_*.rb"]
- p.clean_globs |= CLEAN #An array of file patterns to delete on clean.
-
- # == Optional
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
-end
-
-CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
-PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
-hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
-
-desc 'Generate website files'
-task :website_generate do
- Dir['website/**/*.txt'].each do |txt|
- sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
- end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
end
-desc 'Upload website files to rubyforge'
-task :website_upload do
- host = "#{rubyforge_username}@rubyforge.org"
- remote_dir = "/var/www/gforge-projects/#{PATH}/"
- local_dir = 'website'
- sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
+desc 'Generate documentation for the literate_maruku gem.'
+Rake::RDocTask.new(:doc) do |doc|
+ doc.rdoc_dir = 'doc'
+ doc.title = 'ContextR'
+ doc.options << '--line-numbers' << '--inline-source'
+ doc.rdoc_files.include('README.rdoc')
+ doc.rdoc_files.include('lib/**/*.rb')
end
-desc 'Generate and upload website files'
-task :website => [:website_generate, :website_upload, :publish_docs]
-
-desc 'Release the website and new gem version'
-task :deploy => [:check_version, :website, :release] do
- puts "Remember to create SVN tag:"
- puts "svn copy svn+ssh://rubyforge.org/var/svn/#{PATH}/trunk " +
- "svn+ssh://rubyforge.org/var/svn/#{PATH}/tags/contextr-#{VERS} "
- puts "Suggested comment:"
- puts "Tagging release #{CHANGES}"
+desc "Run the tests under test"
+task :test do
+ require 'rake/runtest'
+ Rake.run_tests 'test/**/test_*.rb'
end
-desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
-task :local_deploy => [:website_generate, :install_gem]
-
-task :check_version do
- unless ENV['VERSION']
- puts 'Must pass a VERSION=x.y.z release version'
- exit
- end
- unless ENV['VERSION'] == VERS
- puts "Please update your version.rb to match the release version, currently #{VERS}"
- exit
+begin
+ require 'spec/rake/spectask'
+ desc "Run the specs under spec"
+ Spec::Rake::SpecTask.new do |t|
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/*_spec.rb']
end
-end
-
-desc "Run the specs under spec/models"
-Spec::Rake::SpecTask.new do |t|
- t.spec_opts = ['--options', "spec/spec.opts"]
- t.spec_files = FileList['spec/*_spec.rb']
+rescue LoadError
+ puts "RSpec not available. Install it with: sudo gem install rspec"
end
desc "Run specs and tests by default"
View
4 VERSION.yml
@@ -0,0 +1,4 @@
+---
+:major: 1
+:minor: 0
+:patch: 3
View
118 contextr.gemspec
@@ -0,0 +1,118 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{contextr}
+ s.version = "1.0.3"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Gregor Schmidt"]
+ s.date = %q{2009-12-03}
+ s.description = %q{The goal is to equip Ruby with an API to allow context-oriented programming.}
+ s.email = %q{ruby@schmidtwisser.de}
+ s.extra_rdoc_files = [
+ "LICENSE.txt",
+ "README.rdoc"
+ ]
+ s.files = [
+ ".gitignore",
+ "GPL.txt",
+ "History.txt",
+ "LICENSE.txt",
+ "MIT.txt",
+ "README.rdoc",
+ "RUBY.txt",
+ "Rakefile",
+ "TODO.taskpaper",
+ "VERSION.yml",
+ "autotest/discover.rb",
+ "autotest/rspec_test.rb",
+ "benchmark/contextr/bench.rb",
+ "benchmark/contextr/results_for_different_hashes.txt",
+ "examples/README",
+ "examples/employer.rb",
+ "examples/node.rb",
+ "lib/contextr.rb",
+ "lib/contextr/class_methods.rb",
+ "lib/contextr/core_ext.rb",
+ "lib/contextr/core_ext/module.rb",
+ "lib/contextr/core_ext/object.rb",
+ "lib/contextr/event_machine.rb",
+ "lib/contextr/inner_class.rb",
+ "lib/contextr/layer.rb",
+ "lib/contextr/modules/mutex_code.rb",
+ "lib/contextr/modules/unique_id.rb",
+ "lib/contextr/public_api.rb",
+ "lib/ext/active_support_subset.rb",
+ "lib/ext/dynamic.rb",
+ "setup.rb",
+ "spec/contextr_spec.rb",
+ "spec/spec.opts",
+ "spec/spec_helper.rb",
+ "test/class_side.mkd",
+ "test/dynamic_scope.mkd",
+ "test/dynamics.mkd",
+ "test/hello_world.mkd",
+ "test/introduction.mkd",
+ "test/layer_state.mkd",
+ "test/lib/example_test.rb",
+ "test/lib/literate_maruku_test.rb",
+ "test/meta_api.mkd",
+ "test/method_missing.mkd",
+ "test/ordering.mkd",
+ "test/restrictions.mkd",
+ "test/test_contextr.rb",
+ "test/test_helper.rb",
+ "test/test_plain.rb",
+ "website/ContextR_euruko_2008.pdf",
+ "website/index.html",
+ "website/index.txt",
+ "website/javascripts/rounded_corners_lite.inc.js",
+ "website/stylesheets/screen.css",
+ "website/template.rhtml"
+ ]
+ s.homepage = %q{http://github.com/schmidt/contextr}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{Context-oriented programming API for Ruby}
+ s.test_files = [
+ "spec/contextr_spec.rb",
+ "spec/spec_helper.rb",
+ "test/lib/example_test.rb",
+ "test/lib/literate_maruku_test.rb",
+ "test/test_contextr.rb",
+ "test/test_helper.rb",
+ "test/test_plain.rb",
+ "examples/employer.rb",
+ "examples/node.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<rake>, [">= 0"])
+ s.add_development_dependency(%q<markaby>, [">= 0"])
+ s.add_development_dependency(%q<literate_maruku>, [">= 0"])
+ s.add_development_dependency(%q<rspec>, [">= 0"])
+ s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
+ else
+ s.add_dependency(%q<rake>, [">= 0"])
+ s.add_dependency(%q<markaby>, [">= 0"])
+ s.add_dependency(%q<literate_maruku>, [">= 0"])
+ s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<jeweler>, [">= 1.4.0"])
+ end
+ else
+ s.add_dependency(%q<rake>, [">= 0"])
+ s.add_dependency(%q<markaby>, [">= 0"])
+ s.add_dependency(%q<literate_maruku>, [">= 0"])
+ s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<jeweler>, [">= 1.4.0"])
+ end
+end
+
View
2  lib/contextr.rb
@@ -11,7 +11,7 @@ module ContextR
# the basic library code
%w{public_api class_methods layer
- event_machine core_ext version
+ event_machine core_ext
inner_class}.each { | file |
require File.dirname(__FILE__) + "/contextr/#{file}" }
View
9 lib/contextr/version.rb
@@ -1,9 +0,0 @@
-module ContextR #:nodoc:
- module VERSION #:nodoc:
- MAJOR = 1
- MINOR = 0
- TINY = 2
-
- STRING = [MAJOR, MINOR, TINY].join('.')
- end
-end
View
67 scripts/txt2html
@@ -1,67 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'rubygems'
-require 'redcloth'
-require 'syntax/convertors/html'
-require 'erb'
-require File.dirname(__FILE__) + '/../lib/contextr/version.rb'
-
-version = ContextR::VERSION::STRING
-download = 'http://rubyforge.org/projects/contextr'
-
-class Fixnum
- def ordinal
- # teens
- return 'th' if (10..19).include?(self % 100)
- # others
- case self % 10
- when 1: return 'st'
- when 2: return 'nd'
- when 3: return 'rd'
- else return 'th'
- end
- end
-end
-
-class Time
- def pretty
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
- end
-end
-
-def convert_syntax(syntax, source)
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
-end
-
-if ARGV.length >= 1
- src, template = ARGV
- template ||= File.dirname(__FILE__) + '/../website/template.rhtml'
-
-else
- puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
- exit!
-end
-
-template = ERB.new(File.open(template).read)
-
-title = nil
-body = nil
-File.open(src) do |fsrc|
- title_text = fsrc.readline
- body_text = fsrc.read
- syntax_items = []
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</>!m){
- ident = syntax_items.length
- element, syntax, source = $1, $2, $3
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
- "syntax-temp-#{ident}"
- }
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
- body = RedCloth.new(body_text).to_html
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
-end
-stat = File.stat(src)
-created = stat.ctime
-modified = stat.mtime
-
-$stdout << template.result(binding)
View
5 test/lib/literate_maruku_test.rb
@@ -29,13 +29,16 @@ module LiterateMarukuTest
TARGET_DIR = File.dirname(__FILE__) + "/../../website/test/"
def self.load(test)
+ require "yaml"
+
content = LiterateMaruku.require(
BASE_DIR + "#{test}.mkd",
:inline => true,
:attributes => {:execute => true})
download = "http://rubyforge.org/projects/contextr"
- version = ContextR::VERSION::STRING
+ version = YAML::load(File.join(BASE_DIR, "version.yml"))
+ version = [version[:major], version[:minor], version[:patch]].join(".")
modified = Time.now
sub_title = test.titleize
Please sign in to comment.
Something went wrong with that request. Please try again.