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

root/branches/1-2-stable/activesupport/Rakefile

Revision 6416, 2.6 kB (checked in by david, 2 years ago)

Use inline rubyforge automation

Line 
1 require 'rake/testtask'
2 require 'rake/rdoctask'
3 require 'rake/gempackagetask'
4 require 'rake/contrib/rubyforgepublisher'
5 require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version')
6
7 PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
8 PKG_NAME      = 'activesupport'
9 PKG_VERSION   = ActiveSupport::VERSION::STRING + PKG_BUILD
10 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
11
12 RELEASE_NAME  = "REL #{PKG_VERSION}"
13
14 RUBY_FORGE_PROJECT = "activesupport"
15 RUBY_FORGE_USER    = "webster132"
16
17 task :default => :test
18 Rake::TestTask.new { |t|
19   t.pattern = 'test/**/*_test.rb'
20   t.verbose = true
21   t.warning = true
22 }
23
24 # Create compressed packages
25 dist_dirs = [ "lib", "test"]
26
27 # Genereate the RDoc documentation
28
29 Rake::RDocTask.new { |rdoc|
30   rdoc.rdoc_dir = 'doc'
31   rdoc.title    = "Active Support -- Utility classes and standard library extensions from Rails"
32   rdoc.options << '--line-numbers' << '--inline-source'
33   rdoc.template = "#{ENV['template']}.rb" if ENV['template']
34   rdoc.rdoc_files.include('README', 'CHANGELOG')
35   rdoc.rdoc_files.include('lib/active_support.rb')
36   rdoc.rdoc_files.include('lib/active_support/*.rb')
37   rdoc.rdoc_files.include('lib/active_support/**/*.rb')
38 }
39
40 spec = Gem::Specification.new do |s|
41   s.name = PKG_NAME
42   s.version = PKG_VERSION
43   s.summary = "Support and utility classes used by the Rails framework."
44   s.description = %q{Utility library which carries commonly used classes and goodies from the Rails framework}
45
46   s.files = [ "CHANGELOG", "README" ] + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
47   s.require_path = 'lib'
48   s.has_rdoc = true
49
50   s.author = "David Heinemeier Hansson"
51   s.email = "david@loudthinking.com"
52   s.homepage = "http://www.rubyonrails.org"
53   s.rubyforge_project = "activesupport"
54 end
55
56 Rake::GemPackageTask.new(spec) do |p|
57   p.gem_spec = spec
58   p.need_tar = true
59   p.need_zip = true
60 end
61
62 desc "Publish the beta gem"
63 task :pgem => [:package] do
64   Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
65   `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
66 end
67
68 desc "Publish the API documentation"
69 task :pdoc => [:rdoc] do
70   Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/as", "doc").upload
71 end
72
73 desc "Publish the release files to RubyForge."
74 task :release => [ :package ] do
75   require 'rubyforge'
76
77   packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
78
79   rubyforge = RubyForge.new
80   rubyforge.login
81   rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
82 end
Note: See TracBrowser for help on using the browser.