2004-11-23 20:04:44 -05:00
|
|
|
require 'rake/testtask'
|
2011-05-24 14:08:11 -04:00
|
|
|
require 'rubygems/package_task'
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
desc "Default Task"
|
2012-10-07 13:54:14 -04:00
|
|
|
task default: [ :test ]
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
# Run the unit tests
|
|
|
|
Rake::TestTask.new { |t|
|
|
|
|
t.libs << "test"
|
2010-01-24 13:36:42 -05:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
2009-11-10 00:42:17 -05:00
|
|
|
t.warning = true
|
2012-02-03 08:01:24 -05:00
|
|
|
t.verbose = true
|
2014-09-27 10:37:44 -04:00
|
|
|
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
|
2004-11-23 20:04:44 -05:00
|
|
|
}
|
|
|
|
|
2009-11-10 19:50:15 -05:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
2010-01-24 13:36:42 -05:00
|
|
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
2013-07-26 05:07:25 -04:00
|
|
|
sh(Gem.ruby, '-w', '-Ilib:test', file)
|
2009-11-10 19:50:15 -05:00
|
|
|
end or raise "Failures"
|
|
|
|
end
|
2009-05-13 04:10:37 -04:00
|
|
|
end
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2009-09-25 01:46:04 -04:00
|
|
|
spec = eval(File.read('actionmailer.gemspec'))
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2011-05-24 14:08:11 -04:00
|
|
|
Gem::PackageTask.new(spec) do |p|
|
2004-11-23 20:04:44 -05:00
|
|
|
p.gem_spec = spec
|
|
|
|
end
|
|
|
|
|
2013-06-21 04:57:00 -04:00
|
|
|
desc "Release to rubygems"
|
2012-10-07 13:54:14 -04:00
|
|
|
task release: :package do
|
2010-02-05 03:03:03 -05:00
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|