2007-01-22 14:43:50 +01:00
|
|
|
require 'rake/testtask'
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
require 'rake/gempackagetask'
|
|
|
|
require 'rake/contrib/rubyforgepublisher'
|
|
|
|
require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version')
|
|
|
|
|
|
|
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
|
|
|
PKG_NAME = 'activesupport'
|
|
|
|
PKG_VERSION = ActiveSupport::VERSION::STRING + PKG_BUILD
|
|
|
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
|
|
|
|
|
|
|
RELEASE_NAME = "REL #{PKG_VERSION}"
|
|
|
|
|
|
|
|
RUBY_FORGE_PROJECT = "activesupport"
|
|
|
|
RUBY_FORGE_USER = "webster132"
|
|
|
|
|
|
|
|
task :default => :test
|
|
|
|
Rake::TestTask.new { |t|
|
|
|
|
t.pattern = 'test/**/*_test.rb'
|
|
|
|
t.verbose = true
|
2007-02-09 09:04:31 +01:00
|
|
|
t.warning = true
|
2007-01-22 14:43:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Create compressed packages
|
|
|
|
dist_dirs = [ "lib", "test"]
|
|
|
|
|
|
|
|
# Genereate the RDoc documentation
|
|
|
|
|
|
|
|
Rake::RDocTask.new { |rdoc|
|
|
|
|
rdoc.rdoc_dir = 'doc'
|
|
|
|
rdoc.title = "Active Support -- Utility classes and standard library extensions from Rails"
|
|
|
|
rdoc.options << '--line-numbers' << '--inline-source'
|
2007-12-21 08:48:59 +01:00
|
|
|
rdoc.options << '--charset' << 'utf-8'
|
2007-01-22 14:43:50 +01:00
|
|
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
|
|
|
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
|
|
|
rdoc.rdoc_files.include('lib/active_support.rb')
|
|
|
|
rdoc.rdoc_files.include('lib/active_support/*.rb')
|
|
|
|
rdoc.rdoc_files.include('lib/active_support/**/*.rb')
|
|
|
|
}
|
|
|
|
|
|
|
|
spec = Gem::Specification.new do |s|
|
|
|
|
s.name = PKG_NAME
|
|
|
|
s.version = PKG_VERSION
|
|
|
|
s.summary = "Support and utility classes used by the Rails framework."
|
|
|
|
s.description = %q{Utility library which carries commonly used classes and goodies from the Rails framework}
|
|
|
|
|
2007-02-09 09:04:31 +01:00
|
|
|
s.files = [ "CHANGELOG", "README" ] + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
|
2007-01-22 14:43:50 +01:00
|
|
|
s.require_path = 'lib'
|
|
|
|
s.has_rdoc = true
|
|
|
|
|
|
|
|
s.author = "David Heinemeier Hansson"
|
|
|
|
s.email = "david@loudthinking.com"
|
|
|
|
s.homepage = "http://www.rubyonrails.org"
|
|
|
|
s.rubyforge_project = "activesupport"
|
|
|
|
end
|
|
|
|
|
|
|
|
Rake::GemPackageTask.new(spec) do |p|
|
|
|
|
p.gem_spec = spec
|
|
|
|
p.need_tar = true
|
|
|
|
p.need_zip = true
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Publish the beta gem"
|
|
|
|
task :pgem => [:package] do
|
|
|
|
Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
|
|
|
|
`ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Publish the API documentation"
|
|
|
|
task :pdoc => [:rdoc] do
|
|
|
|
Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/as", "doc").upload
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Publish the release files to RubyForge."
|
|
|
|
task :release => [ :package ] do
|
2007-03-18 17:56:12 +01:00
|
|
|
require 'rubyforge'
|
2007-01-22 14:43:50 +01:00
|
|
|
|
2007-03-18 17:56:12 +01:00
|
|
|
packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
|
|
|
|
|
|
|
|
rubyforge = RubyForge.new
|
|
|
|
rubyforge.login
|
|
|
|
rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
|
2007-12-21 08:48:59 +01:00
|
|
|
end
|