Permalink
Browse files

+ Switched to newer rdoc and gem package tasks (and their requires).

+ Fixed deprecated usage in gemspecs.

Bumped the version to 2.3.12 so I could test locally with actual
installs. If this is bad form for this project, please beat me up and
I'll split them out.
  • Loading branch information...
1 parent 3ad5fd1 commit 79aa54d0c781ea518e09d62c48e70d2d5619fe33 @zenspider zenspider committed May 25, 2011
View
@@ -1,5 +1,5 @@
require 'rake'
-require 'rake/rdoctask'
+require 'rdoc/task'
env = %(PKG_BUILD="#{ENV['PKG_BUILD']}") if ENV['PKG_BUILD']
@@ -23,7 +23,7 @@ end
desc "Generate documentation for the Rails framework"
-Rake::RDocTask.new do |rdoc|
+RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
rdoc.title = "Ruby on Rails Documentation"
rdoc.main = "railties/README"
View
@@ -1,9 +1,9 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -29,7 +29,7 @@ Rake::TestTask.new { |t|
# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
+RDoc::Task.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'
@@ -54,19 +54,17 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionmailer"
s.homepage = "http://www.rubyonrails.org"
- s.add_dependency('actionpack', '= 2.3.11' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.3.12' + PKG_BUILD)
- s.has_rdoc = true
s.requirements << 'none'
s.require_path = 'lib'
- s.autorequire = 'action_mailer'
s.files = [ "Rakefile", "install.rb", "README", "CHANGELOG", "MIT-LICENSE" ]
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|
+Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -2,7 +2,7 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 11
+ TINY = 12
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
@@ -1,9 +1,9 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'action_pack', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -45,7 +45,7 @@ end
# Genereate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
+RDoc::Task.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Action Pack -- On rails from request to response"
rdoc.options << '--line-numbers' << '--inline-source'
@@ -76,22 +76,20 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionpack"
s.homepage = "http://www.rubyonrails.org"
- s.has_rdoc = true
s.requirements << 'none'
- s.add_dependency('activesupport', '= 2.3.11' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.12' + PKG_BUILD)
s.add_dependency('rack', '~> 1.1.0')
s.require_path = 'lib'
- s.autorequire = 'action_controller'
s.files = [ "Rakefile", "install.rb", "README", "RUNNING_UNIT_TESTS", "CHANGELOG", "MIT-LICENSE" ]
dist_dirs.each do |dir|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
end
-Rake::GemPackageTask.new(spec) do |p|
+Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 11
+ TINY = 12
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
task :default => :test
@@ -13,7 +13,7 @@ Rake::TestTask.new do |t|
end
# Generate the RDoc documentation
-Rake::RDocTask.new do |rdoc|
+RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Active Model"
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
View
@@ -1,9 +1,9 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'active_record', 'version')
require File.expand_path(File.dirname(__FILE__)) + "/test/config"
@@ -157,7 +157,7 @@ task :rebuild_frontbase_databases => 'frontbase:rebuild_databases'
# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
+RDoc::Task.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'
@@ -192,16 +192,14 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
- s.add_dependency('activesupport', '= 2.3.11' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.12' + PKG_BUILD)
s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite"
s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite"
s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite3"
s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite3"
s.require_path = 'lib'
- s.autorequire = 'active_record'
- s.has_rdoc = true
s.extra_rdoc_files = %w( README )
s.rdoc_options.concat ['--main', 'README']
@@ -211,7 +209,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "activerecord"
end
-Rake::GemPackageTask.new(spec) do |p|
+Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -2,7 +2,7 @@ module ActiveRecord
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 11
+ TINY = 12
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
@@ -1,9 +1,9 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'active_resource', 'version')
@@ -38,7 +38,7 @@ Rake::TestTask.new { |t|
# Generate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
+RDoc::Task.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Active Resource -- Object-oriented REST services"
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
@@ -66,12 +66,10 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
- s.add_dependency('activesupport', '= 2.3.11' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.12' + PKG_BUILD)
s.require_path = 'lib'
- s.autorequire = 'active_resource'
- s.has_rdoc = true
s.extra_rdoc_files = %w( README )
s.rdoc_options.concat ['--main', 'README']
@@ -81,7 +79,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "activeresource"
end
-Rake::GemPackageTask.new(spec) do |p|
+Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -2,7 +2,7 @@ module ActiveResource
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 11
+ TINY = 12
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
@@ -1,6 +1,6 @@
require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
+require 'rdoc/task'
+require 'rubygems/package_task'
require File.join(File.dirname(__FILE__), 'lib', 'active_support', 'version')
@@ -27,7 +27,7 @@ dist_dirs = [ "lib", "test"]
# Genereate the RDoc documentation
-Rake::RDocTask.new { |rdoc|
+RDoc::Task.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Active Support -- Utility classes and standard library extensions from Rails"
rdoc.options << '--line-numbers' << '--inline-source'
@@ -48,15 +48,14 @@ spec = Gem::Specification.new do |s|
s.files = [ "CHANGELOG", "README" ] + Dir.glob( "lib/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
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|
+Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
@@ -2,7 +2,7 @@ module ActiveSupport
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 11
+ TINY = 12
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
@@ -1,7 +1,7 @@
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
+require 'rdoc/task'
+require 'rubygems/package_task'
require 'date'
require 'rbconfig'
@@ -267,7 +267,7 @@ task :generate_app_doc do
system %{cd #{PKG_DESTINATION}; rake doc:app}
end
-Rake::RDocTask.new { |rdoc|
+RDoc::Task.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'
@@ -313,28 +313,26 @@ spec = Gem::Specification.new do |s|
EOF
s.add_dependency('rake', '>= 0.8.3')
- s.add_dependency('activesupport', '= 2.3.11' + PKG_BUILD)
- s.add_dependency('activerecord', '= 2.3.11' + PKG_BUILD)
- s.add_dependency('actionpack', '= 2.3.11' + PKG_BUILD)
- s.add_dependency('actionmailer', '= 2.3.11' + PKG_BUILD)
- s.add_dependency('activeresource', '= 2.3.11' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.12' + PKG_BUILD)
+ s.add_dependency('activerecord', '= 2.3.12' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.3.12' + PKG_BUILD)
+ s.add_dependency('actionmailer', '= 2.3.12' + PKG_BUILD)
+ s.add_dependency('activeresource', '= 2.3.12' + PKG_BUILD)
s.rdoc_options << '--exclude' << '.'
- s.has_rdoc = false
s.files = PKG_FILES
s.require_path = 'lib'
s.bindir = "bin" # Use these for applications.
s.executables = ["rails"]
- s.default_executable = "rails"
s.author = "David Heinemeier Hansson"
s.email = "david@loudthinking.com"
s.homepage = "http://www.rubyonrails.org"
s.rubyforge_project = "rails"
end
-Rake::GemPackageTask.new(spec) do |pkg|
+Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
@@ -2,7 +2,7 @@ module Rails
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 11
+ TINY = 12
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -1,6 +1,6 @@
require 'rake'
require 'rake/testtask'
-require 'rake/rdoctask'
+require 'rdoc/task'
@cgriego

cgriego Jun 9, 2011

Contributor

If Rails ~> 2.3.12 now depends on the rdoc gem, shouldn't that be declared in the gemspec?

@kylev

kylev Jul 3, 2011

Seconded. I just got bit by this upgrading an app to 2.3.12. It's a shadow dependency that breaks functionality out of the box. Since it isn't required by core rails but only in the Rakefiles, I got away with "gem 'rdoc', :require => nil" in my Gemfile.

desc 'Default: run unit tests.'
task :default => :test
@@ -14,7 +14,7 @@ Rake::TestTask.new(:test) do |t|
end
desc 'Generate documentation for the <%= file_name %> plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
+RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = '<%= class_name %>'
rdoc.options << '--line-numbers' << '--inline-source'
@@ -1,6 +1,6 @@
namespace :doc do
desc "Generate documentation for the application. Set custom template with TEMPLATE=/path/to/rdoc/template.rb or title with TITLE=\"Custom Title\""
- Rake::RDocTask.new("app") { |rdoc|
+ RDoc::Task.new("app") { |rdoc|
rdoc.rdoc_dir = 'doc/app'
rdoc.template = ENV['template'] if ENV['template']
rdoc.title = ENV['title'] || "Rails Application Documentation"
@@ -12,7 +12,7 @@ namespace :doc do
}
desc "Generate documentation for the Rails framework"
- Rake::RDocTask.new("rails") { |rdoc|
+ RDoc::Task.new("rails") { |rdoc|
rdoc.rdoc_dir = 'doc/api'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
rdoc.title = "Rails Framework Documentation"

6 comments on commit 79aa54d

Owner

fxn replied Feb 15, 2013

Hi @zenspider, was you able to generate the API after this patch?

rake rdoc does not run with RDoc 2.3.0 because of the new code. With 2.4.2 you get a usage dump because of the error "invalid option: -A cattr_accessor=object", and with 2.5 you get "invalid option: --line-numbers" and an error message about the existence of the "doc" directory (albeit the destination "doc/rdoc" does not exist).

We need to be able to run "rake rdoc", and have doc/template/horo.rb used as template as always in 2.3.x.

Contributor

zenspider replied Feb 15, 2013

New code? This commit is 2 years old. It must have worked then.

Owner

fxn replied Feb 15, 2013

Yeah, by "new code" I meant the new code introduced by this patch.

If I am not mistaken the API of 2-3-stable has not been regenerated in two years.

Contributor

zenspider replied Feb 15, 2013

The changes I made were to deal with looong standing deprecations between rake's doco tasks switching to rdoc's doco tasks. Again. I'm pretty sure my changes worked then. rdoc 2.3.0 is dated 2009-01-28, so I don't know what you're asking of me at this point.

Maybe you should be using a newer rdoc install? And ensure that you're picking up the right rdoc task?

Owner

fxn replied Feb 15, 2013

Yeah, I tried all 2.x versions an none worked. I tried all 2.x versions with the previous Rakefiles and they didn't succeed either. It's been a while but I am almost certain that we depended on an old version of RDoc due to the jamis template.

I could generate the API reverting this and running the task with no gem installed, so that it picked the RDoc 1.0.1 distributed with 1.8.7.

Owner

fxn replied Feb 15, 2013

Yep, I am going to revert this patch except for the versions (so manual revert). Note this is 2-3-stable, recent branches are different.

Please sign in to comment.