diff options
author | Akira Matsuda <ronnie@dio.jp> | 2011-05-26 00:15:23 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2011-05-26 00:15:23 +0900 |
commit | 24b28a2a0c6a58e177b07ce3ccf56dc975541780 (patch) | |
tree | 16eb9c8879573b1f90fea2ddf5144745a7bac120 | |
parent | 41eac9b3f6b4a38de3b4c38e5b8d9f0e6b3cb08a (diff) | |
download | rails-24b28a2a0c6a58e177b07ce3ccf56dc975541780.tar.gz rails-24b28a2a0c6a58e177b07ce3ccf56dc975541780.tar.bz2 rails-24b28a2a0c6a58e177b07ce3ccf56dc975541780.zip |
require 'rake/rdoctask' if failed to require 'rdoc/task'
fixes a regression introduced by b921679d0dd3d5ca16f0362c2b34e7703cfe15e5
require 'rdoc/task' fails if the system RDoc version is below 2.4.2 (e.g. CRuby 1.8.7)
-rwxr-xr-x | Rakefile | 7 | ||||
-rwxr-xr-x | railties/lib/rails/generators/rails/plugin_new/templates/Rakefile | 7 | ||||
-rw-r--r-- | railties/lib/rails/tasks/documentation.rake | 6 | ||||
-rw-r--r-- | railties/test/railties/railtie_test.rb | 7 | ||||
-rw-r--r-- | railties/test/railties/shared_tests.rb | 6 |
5 files changed, 27 insertions, 6 deletions
@@ -1,6 +1,11 @@ #!/usr/bin/env rake -require 'rdoc/task' + +begin + require 'rdoc/task' +rescue LoadError + require 'rake/rdoctask' +end require 'net/http' $:.unshift File.expand_path('..', __FILE__) diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile index 1bf9c8c831..0e4c712acb 100755 --- a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile +++ b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile @@ -4,8 +4,11 @@ begin rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end - -require 'rdoc/task' +begin + require 'rdoc/task' +rescue LoadError + require 'rake/rdoctask' +end RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake index c8b4040151..59305322b7 100644 --- a/railties/lib/rails/tasks/documentation.rake +++ b/railties/lib/rails/tasks/documentation.rake @@ -1,4 +1,8 @@ -require 'rdoc/task' +begin + require 'rdoc/task' +rescue LoadError + require 'rake/rdoctask' +end # Monkey-patch to remove redoc'ing and clobber descriptions to cut down on rake -T noise class RDocTaskWithoutDescriptions < RDoc::Task diff --git a/railties/test/railties/railtie_test.rb b/railties/test/railties/railtie_test.rb index 18fdf59fe3..4b94942e1f 100644 --- a/railties/test/railties/railtie_test.rb +++ b/railties/test/railties/railtie_test.rb @@ -97,7 +97,12 @@ module RailtiesTest assert !$ran_block require 'rake' require 'rake/testtask' - require 'rdoc/task' + begin + require 'rdoc/task' + rescue LoadError + require 'rake/rdoctask' + end + AppTemplate::Application.load_tasks assert $ran_block diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index 659551d08a..fdeddcf659 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -237,7 +237,11 @@ module RailtiesTest boot_rails require 'rake' - require 'rdoc/task' + begin + require 'rdoc/task' + rescue LoadError + require 'rake/rdoctask' + end require 'rake/testtask' Rails.application.load_tasks Rake::Task[:foo].invoke |