Rakefile in ruote-2.1.11 vs Rakefile in ruote-2.2.0
- old
+ new
@@ -1,101 +1,100 @@
-require 'lib/ruote/version.rb'
+$:.unshift('.') # 1.9.2
require 'rubygems'
+require 'rubygems/user_interaction' if Gem::RubyGemsVersion == '1.5.0'
+
require 'rake'
+require 'rake/clean'
+require 'rake/rdoctask'
+
#
# clean
-require 'rake/clean'
-CLEAN.include('pkg', 'rdoc', 'ruote_work', 'ruote_data', 'logs')
+CLEAN.include('pkg', 'rdoc', 'ruote_work', 'ruote_data')
-task :default => [ :clean ]
-
#
-# jeweler tasks
+# test
-begin
+task :test do
- require 'jeweler'
+ sh 'ruby -I. test/unit/test.rb'
+ sh 'ruby -I. test/functional/test.rb'
+end
- Jeweler::Tasks.new do |gem|
+task :default => [ :test ]
- gem.version = Ruote::VERSION
- gem.name = 'ruote'
- gem.summary = 'an open source ruby workflow engine'
- gem.description = %{
-ruote is an open source ruby workflow engine.
- }
- gem.email = 'jmettraux@gmail.com'
- gem.homepage = 'http://ruote.rubyforge.org'
- gem.authors = [ 'John Mettraux', 'Kenneth Kalmer', 'Torsten Schoenebaum' ]
- gem.rubyforge_project = 'ruote'
- gem.test_file = 'test/test.rb'
- gem.add_dependency 'rufus-json', '>= 0.2.5'
- gem.add_dependency 'rufus-cloche', '>= 0.1.20'
- gem.add_dependency 'rufus-dollar'
- gem.add_dependency 'rufus-mnemo', '>= 1.1.0'
- gem.add_dependency 'rufus-scheduler', '>= 2.0.5'
- gem.add_dependency 'rufus-treechecker', '>= 1.0.3'
+#
+# gem
- gem.add_development_dependency 'rake'
- gem.add_development_dependency 'yard'
- gem.add_development_dependency 'json'
- gem.add_development_dependency 'builder'
- gem.add_development_dependency 'mailtrap'
- gem.add_development_dependency 'jeweler'
+GEMSPEC_FILE = Dir['*.gemspec'].first
+GEMSPEC = eval(File.read(GEMSPEC_FILE))
+GEMSPEC.validate
- # Gem::Specification http://www.rubygems.org/read/chapter/20
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
+desc %{
+ builds the gem and places it in pkg/
+}
+task :build do
+
+ 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
-#
-# rdoc
+ sh "gem push pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem"
+end
-#begin
-# require 'yard'
-# YARD::Rake::YardocTask.new do |doc|
-# doc.options = [ '-o', 'rdoc', '--title', "ruote #{Ruote::VERSION}" ]
-# end
-#rescue LoadError
-# task :yard do
-# abort 'YARD is not available. In order to run yardoc, you must: sudo gem install yard'
-# end
-#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'
rd.rdoc_files.include(
'README.rdoc', 'CHANGELOG.txt', 'CREDITS.txt', 'lib/**/*.rb')
- rd.title = "ruote #{Ruote::VERSION}"
+ rd.title = "#{GEMSPEC.name} #{GEMSPEC.version}"
end
#
# upload_rdoc
-desc 'Upload the documentation to rubyforge'
+desc %{
+ upload the rdoc to rubyforge
+}
task :upload_rdoc => [ :clean, :rdoc ] do
account = 'jmettraux@rubyforge.org'
webdir = '/var/www/gforge-projects/ruote'
sh "rsync -azv -e ssh rdoc #{account}:#{webdir}/"
+end
+
+
+desc %{
+ attempt at detecting test methods with the same name
+}
+task :doublons do
+
+ lines = `grep -r " def test_" test/ | sort`.split("\n")
+ lines.inject(nil) do |previous, line|
+ p line if line == previous
+ line
+ end
end