Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

root/trunk/actionmailer/Rakefile

Revision 9054, 2.9 kB (checked in by david, 6 months ago)

sshpublisher needs to be explicitly required now, apparently

  • Property svn:executable set to *
Line 
1 require 'rubygems'
2 require 'rake'
3 require 'rake/testtask'
4 require 'rake/rdoctask'
5 require 'rake/packagetask'
6 require 'rake/gempackagetask'
7 require 'rake/contrib/sshpublisher'
8 require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
9
10 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
11 PKG_NAME      = 'actionmailer'
12 PKG_VERSION   = ActionMailer::VERSION::STRING + PKG_BUILD
13 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
15 RELEASE_NAME  = "REL #{PKG_VERSION}"
16
17 RUBY_FORGE_PROJECT = "actionmailer"
18 RUBY_FORGE_USER    = "webster132"
19
20 desc "Default Task"
21 task :default => [ :test ]
22
23 # Run the unit tests
24 Rake::TestTask.new { |t|
25   t.libs << "test"
26   t.pattern = 'test/*_test.rb'
27   t.verbose = true
28   t.warning = false
29 }
30
31
32 # Generate the RDoc documentation
33 Rake::RDocTask.new { |rdoc|
34   rdoc.rdoc_dir = 'doc'
35   rdoc.title    = "Action Mailer -- Easy email delivery and testing"
36   rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
37   rdoc.options << '--charset' << 'utf-8'
38   rdoc.template = "#{ENV['template']}.rb" if ENV['template']
39   rdoc.rdoc_files.include('README', 'CHANGELOG')
40   rdoc.rdoc_files.include('lib/action_mailer.rb')
41   rdoc.rdoc_files.include('lib/action_mailer/*.rb')
42 }
43
44
45 # Create compressed packages
46 spec = Gem::Specification.new do |s|
47   s.platform = Gem::Platform::RUBY
48   s.name = PKG_NAME
49   s.summary = "Service layer for easy email delivery and testing."
50   s.description = %q{Makes it trivial to test and deliver emails sent from a single service layer.}
51   s.version = PKG_VERSION
52
53   s.author = "David Heinemeier Hansson"
54   s.email = "david@loudthinking.com"
55   s.rubyforge_project = "actionmailer"
56   s.homepage = "http://www.rubyonrails.org"
57
58   s.add_dependency('actionpack', '= 2.0.2' + PKG_BUILD)
59
60   s.has_rdoc = true
61   s.requirements << 'none'
62   s.require_path = 'lib'
63   s.autorequire = 'action_mailer'
64
65   s.files = [ "Rakefile", "install.rb", "README", "CHANGELOG", "MIT-LICENSE" ]
66   s.files = s.files + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
67   s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
68 end
69  
70 Rake::GemPackageTask.new(spec) do |p|
71   p.gem_spec = spec
72   p.need_tar = true
73   p.need_zip = true
74 end
75
76
77 desc "Publish the API documentation"
78 task :pgem => [:package] do
79   Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
80 end
81
82 desc "Publish the API documentation"
83 task :pdoc => [:rdoc] do
84   Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/am", "doc").upload
85 end
86
87 desc "Publish the release files to RubyForge."
88 task :release => [ :package ] do
89   require 'rubyforge'
90   require 'rake/contrib/rubyforgepublisher'
91
92   packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
93
94   rubyforge = RubyForge.new
95   rubyforge.login
96   rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
97 end
Note: See TracBrowser for help on using the browser.