Rakefile 1.7 KB
Newer Older
1
require 'rake/testtask'
D
David Heinemeier Hansson 已提交
2
require 'rake/rdoctask'
3
require 'rake/gempackagetask'
4
require 'rake/gemcutter'
5

6
require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version')
7 8 9

PKG_BUILD     = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
PKG_NAME      = 'activesupport'
10
PKG_VERSION   = ActiveSupport::VERSION::STRING + PKG_BUILD
11
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12

13 14 15 16 17
RELEASE_NAME  = "REL #{PKG_VERSION}"

RUBY_FORGE_PROJECT = "activesupport"
RUBY_FORGE_USER    = "webster132"

18
task :default => :test
19 20
Rake::TestTask.new do |t|
  t.libs << 'test'
21
  t.pattern = 'test/**/*_test.rb'
22
  t.warning = true
23 24 25 26 27 28
end

namespace :test do
  Rake::TestTask.new(:isolated) do |t|
    t.pattern = 'test/ts_isolated.rb'
  end
29
end
30 31 32 33

# Create compressed packages
dist_dirs = [ "lib", "test"]

D
David Heinemeier Hansson 已提交
34 35 36 37 38
# Genereate the RDoc documentation

Rake::RDocTask.new { |rdoc|
  rdoc.rdoc_dir = 'doc'
  rdoc.title    = "Active Support -- Utility classes and standard library extensions from Rails"
D
David Heinemeier Hansson 已提交
39
  rdoc.options << '--line-numbers' << '--inline-source'
40
  rdoc.options << '--charset' << 'utf-8'
J
Jeremy Kemper 已提交
41
  rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
D
David Heinemeier Hansson 已提交
42 43
  rdoc.rdoc_files.include('README', 'CHANGELOG')
  rdoc.rdoc_files.include('lib/active_support.rb')
44
  rdoc.rdoc_files.include('lib/active_support/**/*.rb')
D
David Heinemeier Hansson 已提交
45 46
}

47
spec = eval(File.read('activesupport.gemspec'))
48 49 50 51 52

Rake::GemPackageTask.new(spec) do |p|
  p.gem_spec = spec
end

J
Jeremy Kemper 已提交
53
Rake::Gemcutter::Tasks.new(spec).define
54 55 56

desc "Release to gemcutter"
task :release => [:package, 'gem:push']
57 58

desc "Publish the API documentation"
59
task :pdoc => [:rdoc] do
60
  require 'rake/contrib/sshpublisher'
61
  Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload
62
end