Skip to content

Commit

Permalink
updating rakefile to use jeweler instead of newgem
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt committed Dec 3, 2009
1 parent 61da414 commit bd6b5d3
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 243 deletions.
6 changes: 6 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
44 changes: 0 additions & 44 deletions Manifest.txt

This file was deleted.

File renamed without changes.
159 changes: 38 additions & 121 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 4 additions & 0 deletions VERSION.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
:major: 1
:minor: 0
:patch: 3
118 changes: 118 additions & 0 deletions contextr.gemspec
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion lib/contextr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}" }

Expand Down
9 changes: 0 additions & 9 deletions lib/contextr/version.rb

This file was deleted.

Loading

0 comments on commit bd6b5d3

Please sign in to comment.