Rakefile in ruote-dm-2.1.11 vs Rakefile in ruote-dm-2.2.0
- old
+ new
@@ -1,78 +1,92 @@
+$:.unshift('.') # 1.9.2
+
require 'rubygems'
+
require 'rake'
+require 'rake/clean'
+require 'rake/rdoctask'
-require 'lib/ruote/dm/version.rb'
#
-# CLEAN
+# clean
-require 'rake/clean'
-CLEAN.include('pkg', 'tmp', 'html')
-task :default => [ :clean ]
+CLEAN.include('pkg', 'rdoc')
#
-# GEM
+# test / spec
-require 'jeweler'
+task :test do
-Jeweler::Tasks.new do |gem|
+ puts
+ puts "to test ruote-dm, head to your ruote/ dir and run"
+ puts
+ puts " ruby test/test.rb -- --dm"
+ puts
+ puts "but first, make sure your ruote-dm/test/functional_connection.rb"
+ puts "is set correctly."
+ puts
+end
- gem.version = Ruote::Dm::VERSION
- gem.name = 'ruote-dm'
- gem.summary = 'datamapper storage for ruote (a ruby workflow engine)'
- gem.description = %{
-datamapper storage for ruote (a ruby workflow engine)
- }.strip
- gem.email = 'jmettraux@gmail.com'
- gem.homepage = 'http://github.com/jmettraux/ruote-dm'
- gem.authors = [ 'John Mettraux' ]
- gem.rubyforge_project = 'ruote'
+task :default => [ :test ]
- gem.test_file = 'test/test.rb'
- gem.add_dependency 'ruote', ">= #{Ruote::Dm::VERSION}"
- gem.add_dependency 'dm-core'
- gem.add_dependency 'dm-migrations'
- #gem.add_dependency 'dm-aggregates'
- #gem.add_dependency 'dm-types'
- 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
+GEMSPEC_FILE = Dir['*.gemspec'].first
+GEMSPEC = eval(File.read(GEMSPEC_FILE))
+GEMSPEC.validate
+
+
+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
-Jeweler::GemcutterTasks.new
+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-dm_rdoc'
+ rd.rdoc_dir = 'rdoc'
rd.rdoc_files.include(
'README.rdoc', 'CHANGELOG.txt', 'CREDITS.txt', 'lib/**/*.rb')
- rd.title = "ruote-dm #{Ruote::Dm::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'
- sh "rsync -azv -e ssh rdoc/ruote-dm_rdoc #{account}:#{webdir}/"
+ sh "rsync -azv -e ssh rdoc/#{GEMSPEC.name}_rdoc #{account}:#{webdir}/"
end