2010-11-25 04:03:04 +08:00
|
|
|
#!/usr/bin/env rake
|
2004-11-24 09:04:44 +08:00
|
|
|
require 'rake/testtask'
|
|
|
|
require 'rake/packagetask'
|
|
|
|
require 'rake/gempackagetask'
|
|
|
|
|
|
|
|
desc "Default Task"
|
|
|
|
task :default => [ :test ]
|
|
|
|
|
|
|
|
# Run the unit tests
|
|
|
|
Rake::TestTask.new { |t|
|
|
|
|
t.libs << "test"
|
2010-01-25 02:36:42 +08:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
2009-11-10 13:42:17 +08:00
|
|
|
t.warning = true
|
2004-11-24 09:04:44 +08:00
|
|
|
}
|
|
|
|
|
2009-11-11 08:50:15 +08:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
|
|
|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
2010-01-25 02:36:42 +08:00
|
|
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
2009-11-11 08:50:15 +08:00
|
|
|
system(ruby, '-Ilib:test', file)
|
|
|
|
end or raise "Failures"
|
|
|
|
end
|
2009-05-13 16:10:37 +08:00
|
|
|
end
|
2004-11-24 09:04:44 +08:00
|
|
|
|
2009-09-25 13:46:04 +08:00
|
|
|
spec = eval(File.read('actionmailer.gemspec'))
|
2004-11-24 09:04:44 +08:00
|
|
|
|
|
|
|
Rake::GemPackageTask.new(spec) do |p|
|
|
|
|
p.gem_spec = spec
|
|
|
|
end
|
|
|
|
|
2010-02-05 10:28:45 +08:00
|
|
|
desc "Release to gemcutter"
|
2010-02-05 16:03:03 +08:00
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|