Rakefile in ruote-couch-2.1.11 vs Rakefile in ruote-couch-2.2.0

- old
+ new

@@ -1,87 +1,90 @@ +$:.unshift('.') # 1.9.2 + require 'rubygems' + require 'rake' +require 'rake/clean' +require 'rake/rdoctask' -require 'lib/ruote/couch/version.rb' # -# CLEAN +# clean -require 'rake/clean' -CLEAN.include('pkg', 'tmp', 'html') +CLEAN.include('pkg', 'rdoc') + task :default => [ :clean ] # -# GEM +# test / spec -require 'jeweler' +task :test do -Jeweler::Tasks.new do |gem| + puts + puts "to test ruote-couch, head to your ruote/ dir and run" + puts + puts " ruby test/test.rb -- --couch" + puts + puts "but first, make sure your ruote-couch/test/functional_connection.rb" + puts "is set correctly." + puts +end - gem.version = Ruote::Couch::VERSION - gem.name = 'ruote-couch' - gem.summary = 'CouchDB storage for ruote 2.1' - gem.description = %{ -CouchDB storage for ruote 2.1 (ruby workflow engine) - }.strip - gem.email = 'jmettraux@gmail.com' - gem.homepage = 'http://github.com/jmettraux/ruote-couch' - gem.authors = [ 'John Mettraux' ] - gem.rubyforge_project = 'ruote' +task :default => [ :test ] - gem.test_file = 'test/test.rb' - #gem.add_dependency 'ruote', ">= #{Ruote::Couch::VERSION}" - gem.add_dependency 'ruote', ">= 2.1.11" - gem.add_dependency 'rufus-jig', '>= 0.1.23' - gem.add_development_dependency 'yard' - gem.add_development_dependency 'rake' - gem.add_development_dependency 'jeweler' +# +# gem - # gemspec spec : http://www.rubygems.org/read/chapter/20 -end -Jeweler::GemcutterTasks.new +GEMSPEC_FILE = Dir['*.gemspec'].first +GEMSPEC = eval(File.read(GEMSPEC_FILE)) +GEMSPEC.validate -# -# MISC -task :delete_all_test_databases do +desc %{ + builds the gem and places it in pkg/ +} +task :build do - require 'json' - require 'rufus/jig' - couch = Rufus::Jig::Couch.new('127.0.0.1', 5984) - %w[ - configurations errors expressions msgs schedules variables workitems - ].each do |type| - couch.delete("/test_ruote_#{type}") - end + sh "gem build #{GEMSPEC_FILE}" + sh "mkdir pkg" rescue nil + sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem pkg/" end +desc %{ + builds the gem and pushes it to rubygems.org +} +task :push => :build do -# -# DOC + sh "gem push pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem" +end + # -# make sure to have rdoc 2.5.x to run that +# rdoc # -require 'rake/rdoctask' +# make sure to have rdoc 2.5.x to run that + Rake::RDocTask.new do |rd| rd.main = 'README.rdoc' rd.rdoc_dir = 'rdoc/ruote-couch_rdoc' rd.rdoc_files.include( 'README.rdoc', 'CHANGELOG.txt', 'CREDITS.txt', 'lib/**/*.rb') - rd.title = "ruote-couch #{Ruote::Couch::VERSION}" + rd.title = "#{GEMSPEC.name} #{GEMSPEC.version}" end # -# TO THE WEB +# upload_rdoc +desc %{ + upload the rdoc to rubyforge +} task :upload_rdoc => [ :clean, :rdoc ] do account = 'jmettraux@rubyforge.org' webdir = '/var/www/gforge-projects/ruote'