2004-11-23 20:04:44 -05:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rake'
|
|
|
|
require 'rake/testtask'
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
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-24 13:36:42 -05:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
2009-11-10 00:42:17 -05:00
|
|
|
t.warning = true
|
2004-11-23 20:04:44 -05:00
|
|
|
}
|
|
|
|
|
2009-11-10 19:50:15 -05:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
|
|
|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
2010-01-24 13:36:42 -05:00
|
|
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
2009-11-10 19:50:15 -05:00
|
|
|
system(ruby, '-Ilib:test', file)
|
|
|
|
end or raise "Failures"
|
|
|
|
end
|
2009-05-13 04:10:37 -04:00
|
|
|
end
|
2004-11-23 20:04:44 -05:00
|
|
|
|
2007-12-05 13:54:41 -05:00
|
|
|
# Generate the RDoc documentation
|
2004-11-23 20:04:44 -05:00
|
|
|
Rake::RDocTask.new { |rdoc|
|
|
|
|
rdoc.rdoc_dir = 'doc'
|
|
|
|
rdoc.title = "Action Mailer -- Easy email delivery and testing"
|
2006-03-27 22:22:58 -05:00
|
|
|
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
|
2007-05-28 18:55:14 -04:00
|
|
|
rdoc.options << '--charset' << 'utf-8'
|
2008-06-22 13:38:25 -04:00
|
|
|
rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
|
2004-11-23 20:04:44 -05:00
|
|
|
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
|
|
|
rdoc.rdoc_files.include('lib/action_mailer.rb')
|
|
|
|
rdoc.rdoc_files.include('lib/action_mailer/*.rb')
|
2009-10-28 05:17:59 -04:00
|
|
|
rdoc.rdoc_files.include('lib/action_mailer/delivery_method/*.rb')
|
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
|
|
|
|
|
|
|
Rake::GemPackageTask.new(spec) do |p|
|
|
|
|
p.gem_spec = spec
|
|
|
|
end
|
|
|
|
|
2010-02-04 21:28:45 -05:00
|
|
|
desc "Release to gemcutter"
|
2010-02-05 03:03:03 -05:00
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|
2004-11-23 20:04:44 -05:00
|
|
|
|
|
|
|
desc "Publish the API documentation"
|
2009-10-16 14:56:59 -04:00
|
|
|
task :pdoc => [:rdoc] do
|
2009-06-08 23:49:21 -04:00
|
|
|
require 'rake/contrib/sshpublisher'
|
2008-06-18 22:56:22 -04:00
|
|
|
Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload
|
2004-11-23 20:04:44 -05:00
|
|
|
end
|