diff options
author | Xavier Noria <fxn@hashref.com> | 2011-05-25 08:26:09 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-05-25 08:26:09 -0700 |
commit | ee46bb73d44338b7dfb8976cc59d742b9394148a (patch) | |
tree | 7b7c78f4f734106b0979ce8ef106479cfb8560ad /railties | |
parent | f116a4835bef4dcfb3a2cfcc915d5cf8681cdf6b (diff) | |
parent | 24b28a2a0c6a58e177b07ce3ccf56dc975541780 (diff) | |
download | rails-ee46bb73d44338b7dfb8976cc59d742b9394148a.tar.gz rails-ee46bb73d44338b7dfb8976cc59d742b9394148a.tar.bz2 rails-ee46bb73d44338b7dfb8976cc59d742b9394148a.zip |
Merge pull request #1301 from amatsuda/require_rdoc_task_fail
require 'rake/rdoctask' if failed to require 'rdoc/task'
Diffstat (limited to 'railties')
-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 |
4 files changed, 21 insertions, 5 deletions
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 |