Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow the branch to be managed with a modern rake

  • Loading branch information...
commit 89322cd467fee8d4fcc16f67a9e7fce5817f746f 1 parent 4d47885
@fxn fxn authored
View
124 Rakefile
@@ -1,20 +1,5 @@
require 'rake'
-if RAKEVERSION != '0.8.0'
- puts <<USAGE
-In order to execute tasks please install Ruby 1.8.7 and rake 0.8.0. Then:
-
- rake _0.8.0_ task_name
-
-Reason is the Jamis template used for the API needs RDoc 1.x. Recent rake libs
-do not provide rake/rdoctask, and RDoc 1.x provides no alternative task. This
-is easy to setup with a Ruby version manager.
-USAGE
- exit 1
-end
-
-require 'rake/rdoctask'
-
env = %(PKG_BUILD="#{ENV['PKG_BUILD']}") if ENV['PKG_BUILD']
PROJECTS = %w(activesupport railties actionpack actionmailer activeresource activerecord)
@@ -30,58 +15,69 @@ task :default => :test
desc "Run #{task_name} task for all projects"
task task_name do
PROJECTS.each do |project|
- system %(cd #{project} && #{env} rake _0.8.0_ #{task_name})
+ system %(cd #{project} && #{env} rake _#{RAKEVERSION}_ #{task_name})
end
end
end
-desc "Generate documentation for the Rails framework"
-Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = 'doc/rdoc'
- rdoc.title = "Ruby on Rails Documentation"
- rdoc.main = "railties/README"
-
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.options << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.options << '--main' << 'railties/README'
-
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
-
- rdoc.rdoc_files.include('railties/CHANGELOG')
- rdoc.rdoc_files.include('railties/MIT-LICENSE')
- rdoc.rdoc_files.include('railties/README')
- rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,rails_generator/*.rb}')
-
- rdoc.rdoc_files.include('activerecord/README')
- rdoc.rdoc_files.include('activerecord/CHANGELOG')
- rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
- rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
-
- rdoc.rdoc_files.include('activeresource/README')
- rdoc.rdoc_files.include('activeresource/CHANGELOG')
- rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
- rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
-
- rdoc.rdoc_files.include('actionpack/README')
- rdoc.rdoc_files.include('actionpack/CHANGELOG')
- rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
- rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
- rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
-
- rdoc.rdoc_files.include('actionmailer/README')
- rdoc.rdoc_files.include('actionmailer/CHANGELOG')
- rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
- rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
-
- rdoc.rdoc_files.include('activesupport/README')
- rdoc.rdoc_files.include('activesupport/CHANGELOG')
- rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
- rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
-end
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # In order to generate the API please install Ruby 1.8.7 and rake 0.8.0. Then:
+ #
+ # rake _0.8.0_ task_name
+ #
+ # Reason is the Jamis template used for the API needs RDoc 1.x. Recent rake libs
+ # do not provide rake/rdoctask, and RDoc 1.x provides no alternative task. This
+ # is easy to setup with a Ruby version manager.
+ desc "Generate documentation for the Rails framework"
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc/rdoc'
+ rdoc.title = "Ruby on Rails Documentation"
+ rdoc.main = "railties/README"
+
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.options << '-A cattr_accessor=object'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.options << '--main' << 'railties/README'
+
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo'
+
+ rdoc.rdoc_files.include('railties/CHANGELOG')
+ rdoc.rdoc_files.include('railties/MIT-LICENSE')
+ rdoc.rdoc_files.include('railties/README')
+ rdoc.rdoc_files.include('railties/lib/{*.rb,commands/*.rb,rails/*.rb,rails_generator/*.rb}')
+
+ rdoc.rdoc_files.include('activerecord/README')
+ rdoc.rdoc_files.include('activerecord/CHANGELOG')
+ rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
+ rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
+
+ rdoc.rdoc_files.include('activeresource/README')
+ rdoc.rdoc_files.include('activeresource/CHANGELOG')
+ rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
+ rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
+
+ rdoc.rdoc_files.include('actionpack/README')
+ rdoc.rdoc_files.include('actionpack/CHANGELOG')
+ rdoc.rdoc_files.include('actionpack/lib/action_controller/**/*.rb')
+ rdoc.rdoc_files.include('actionpack/lib/action_view/**/*.rb')
+ rdoc.rdoc_files.exclude('actionpack/lib/action_controller/vendor/*')
+
+ rdoc.rdoc_files.include('actionmailer/README')
+ rdoc.rdoc_files.include('actionmailer/CHANGELOG')
+ rdoc.rdoc_files.include('actionmailer/lib/action_mailer/base.rb')
+ rdoc.rdoc_files.exclude('actionmailer/lib/action_mailer/vendor/*')
+
+ rdoc.rdoc_files.include('activesupport/README')
+ rdoc.rdoc_files.include('activesupport/CHANGELOG')
+ rdoc.rdoc_files.include('activesupport/lib/active_support/**/*.rb')
+ rdoc.rdoc_files.exclude('activesupport/lib/active_support/vendor/*')
+ end
-# Enhance rdoc task to copy referenced images also
-task :rdoc do
- FileUtils.mkdir_p "doc/rdoc/files/examples/"
- FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
+ # Enhance rdoc task to copy referenced images also
+ task :rdoc do
+ FileUtils.mkdir_p "doc/rdoc/files/examples/"
+ FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
+ end
end
View
42 actionmailer/Rakefile
@@ -1,9 +1,8 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -27,19 +26,21 @@ Rake::TestTask.new { |t|
t.warning = false
}
-
-# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Action Mailer -- Easy email delivery and testing"
- rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- rdoc.rdoc_files.include('README', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/action_mailer.rb')
- rdoc.rdoc_files.include('lib/action_mailer/*.rb')
-}
-
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # Generate the RDoc documentation
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Action Mailer -- Easy email delivery and testing"
+ rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ rdoc.rdoc_files.include('README', 'CHANGELOG')
+ rdoc.rdoc_files.include('lib/action_mailer.rb')
+ rdoc.rdoc_files.include('lib/action_mailer/*.rb')
+ end
+end
# Create compressed packages
spec = Gem::Specification.new do |s|
@@ -65,8 +66,9 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
s.files = s.files + Dir.glob( "test/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
-
-Rake::GemPackageTask.new(spec) do |p|
+
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
+package_task.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -80,12 +82,6 @@ task :pgem => [:package] do
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- require 'rake/contrib/sshpublisher'
- Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload
-end
-
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rubyforge'
View
47 actionpack/Rakefile
@@ -1,9 +1,8 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'action_pack', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -43,23 +42,26 @@ Rake::TestTask.new(:test_active_record_integration) do |t|
end
-# Genereate the RDoc documentation
-
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Action Pack -- On rails from request to response"
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- if ENV['DOC_FILES']
- rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
- else
- rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
- rdoc.rdoc_files.include(Dir['lib/**/*.rb'] -
- Dir['lib/*/vendor/**/*.rb'])
- rdoc.rdoc_files.exclude('lib/actionpack.rb')
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # Generate the RDoc documentation
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Action Pack -- On rails from request to response"
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ if ENV['DOC_FILES']
+ rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
+ else
+ rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
+ rdoc.rdoc_files.include(Dir['lib/**/*.rb'] -
+ Dir['lib/*/vendor/**/*.rb'])
+ rdoc.rdoc_files.exclude('lib/actionpack.rb')
+ end
end
-}
+end
# Create compressed packages
dist_dirs = [ "lib", "test" ]
@@ -91,7 +93,8 @@ spec = Gem::Specification.new do |s|
end
end
-Rake::GemPackageTask.new(spec) do |p|
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
+package_task.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -141,12 +144,6 @@ task :pgem => [:package] do
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- require 'rake/contrib/sshpublisher'
- Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ap", "doc").upload
-end
-
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rubyforge'
View
23 activemodel/Rakefile
@@ -1,7 +1,6 @@
#!/usr/bin/env ruby
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
task :default => :test
@@ -12,13 +11,17 @@ Rake::TestTask.new do |t|
t.warning = true
end
-# Generate the RDoc documentation
-Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Active Model"
- rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- rdoc.rdoc_files.include('README', 'CHANGES')
- rdoc.rdoc_files.include('lib/**/*.rb')
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # Generate the RDoc documentation
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Active Model"
+ rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ rdoc.rdoc_files.include('README', 'CHANGES')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ end
end
View
42 activerecord/Rakefile
@@ -1,9 +1,8 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'active_record', 'version')
require File.expand_path(File.dirname(__FILE__)) + "/test/config"
@@ -154,20 +153,22 @@ end
task :build_frontbase_databases => 'frontbase:build_databases'
task :rebuild_frontbase_databases => 'frontbase:rebuild_databases'
-
-# Generate the RDoc documentation
-
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Active Record -- Object-relation mapping put on rails"
- rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.rdoc_files.exclude('lib/active_record/vendor/*')
- rdoc.rdoc_files.include('dev-utils/*.rb')
-}
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # Generate the RDoc documentation
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Active Record -- Object-relation mapping put on rails"
+ rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.rdoc_files.exclude('lib/active_record/vendor/*')
+ rdoc.rdoc_files.include('dev-utils/*.rb')
+ end
+end
# Enhance rdoc task to copy referenced images also
task :rdoc do
@@ -211,7 +212,8 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "activerecord"
end
-Rake::GemPackageTask.new(spec) do |p|
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
+package_task.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -251,12 +253,6 @@ task :pgem => [:package] do
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- require 'rake/contrib/sshpublisher'
- Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload
-end
-
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rubyforge'
View
40 activeresource/Rakefile
@@ -1,9 +1,8 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'active_resource', 'version')
@@ -35,19 +34,21 @@ Rake::TestTask.new { |t|
t.warning = true
}
-
-# Generate the RDoc documentation
-
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Active Resource -- Object-oriented REST services"
- rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- rdoc.rdoc_files.include('README', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/**/*.rb')
- rdoc.rdoc_files.exclude('lib/activeresource.rb')
-}
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # Generate the RDoc documentation
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Active Resource -- Object-oriented REST services"
+ rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ rdoc.rdoc_files.include('README', 'CHANGELOG')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.rdoc_files.exclude('lib/activeresource.rb')
+ end
+end
# Create compressed packages
@@ -81,7 +82,8 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "activeresource"
end
-Rake::GemPackageTask.new(spec) do |p|
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
+package_task.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -121,12 +123,6 @@ task :pgem => [:package] do
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- require 'rake/contrib/sshpublisher'
- Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload
-end
-
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
`rubyforge login`
View
41 activesupport/Rakefile
@@ -1,6 +1,5 @@
require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version')
@@ -25,19 +24,22 @@ Rake::TestTask.new { |t|
# 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'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- 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.exclude('lib/active_support/vendor/*')
-}
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ # Genereate the RDoc documentation
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Active Support -- Utility classes and standard library extensions from Rails"
+ rdoc.options << '--line-numbers' << '--inline-source'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ 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.exclude('lib/active_support/vendor/*')
+ end
+end
spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
@@ -56,7 +58,8 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "activesupport"
end
-Rake::GemPackageTask.new(spec) do |p|
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
+package_task.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -69,12 +72,6 @@ task :pgem => [:package] do
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
-desc "Publish the API documentation"
-task :pdoc => [:rdoc] do
- require 'rake/contrib/sshpublisher'
- Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload
-end
-
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rubyforge'
View
42 railties/Rakefile
@@ -1,7 +1,6 @@
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
+require RAKEVERSION == '0.8.0' ? 'rake/gempackagetask' : 'rubygems/package_task'
require 'date'
require 'rbconfig'
@@ -267,18 +266,22 @@ task :generate_app_doc do
system %{cd #{PKG_DESTINATION}; rake doc:app}
end
-Rake::RDocTask.new { |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "Railties -- Gluing the Engine to the Rails"
- rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
- rdoc.options << '--charset' << 'utf-8'
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
- rdoc.rdoc_files.include('README', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/*.rb')
- rdoc.rdoc_files.include('lib/rails/*.rb')
- rdoc.rdoc_files.include('lib/rails_generator/*.rb')
- rdoc.rdoc_files.include('lib/commands/**/*.rb')
-}
+if RAKEVERSION == '0.8.0'
+ require 'rake/rdoctask'
+
+ Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'doc'
+ rdoc.title = "Railties -- Gluing the Engine to the Rails"
+ rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
+ rdoc.options << '--charset' << 'utf-8'
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
+ rdoc.rdoc_files.include('README', 'CHANGELOG')
+ rdoc.rdoc_files.include('lib/*.rb')
+ rdoc.rdoc_files.include('lib/rails/*.rb')
+ rdoc.rdoc_files.include('lib/rails_generator/*.rb')
+ rdoc.rdoc_files.include('lib/commands/**/*.rb')
+ end
+end
# Generate GEM ----------------------------------------------------------------------------
@@ -334,7 +337,8 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "rails"
end
-Rake::GemPackageTask.new(spec) do |pkg|
+package_task = RAKEVERSION == '0.8.0' ? Rake::GemPackageTask : Gem::PackageTask
+package_task.new(spec) do |pkg|
pkg.gem_spec = spec
end
@@ -346,14 +350,6 @@ task :pgem => [:gem] do
`ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
-desc "Publish the guides"
-task :pguides => :generate_guides do
- mkdir_p 'pkg'
- `tar -czf pkg/guides.gz guides/output`
- Rake::SshFilePublisher.new("web.rubyonrails.org", "/u/sites/guides.rubyonrails.org/public", "pkg", "guides.gz").upload
- `ssh web.rubyonrails.org 'cd /u/sites/guides.rubyonrails.org/public/ && tar -xvzf guides.gz && mv guides/output/* . && rm -rf guides*'`
-end
-
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rake/contrib/rubyforgepublisher'
Please sign in to comment.
Something went wrong with that request. Please try again.