diff options
author | Akira Matsuda <ronnie@dio.jp> | 2012-02-27 22:09:58 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2012-02-27 22:34:13 +0900 |
commit | 20ca766954bd1af768abd8813baeac6d3561318f (patch) | |
tree | 9e12f1dfabc900ffcfd1d600263d3fa8d4b9e905 /railties/lib/rails | |
parent | 551566db06f54f35aeadaa320ef073ea1335ad60 (diff) | |
download | rails-20ca766954bd1af768abd8813baeac6d3561318f.tar.gz rails-20ca766954bd1af768abd8813baeac6d3561318f.tar.bz2 rails-20ca766954bd1af768abd8813baeac6d3561318f.zip |
ruby19: no need to rescue when requiring 'rdoc/task' in Ruby >= 1.9
Diffstat (limited to 'railties/lib/rails')
-rwxr-xr-x | railties/lib/rails/generators/rails/plugin_new/templates/Rakefile | 9 | ||||
-rw-r--r-- | railties/lib/rails/tasks/documentation.rake | 8 |
2 files changed, 3 insertions, 14 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile index 6ed6adcf1b..b7bc69d2e5 100755 --- a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile +++ b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile @@ -4,13 +4,8 @@ begin rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end -begin - require 'rdoc/task' -rescue LoadError - require 'rdoc/rdoc' - require 'rake/rdoctask' - RDoc::Task = Rake::RDocTask -end + +require 'rdoc/task' 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 e09379c8c2..cec346d86b 100644 --- a/railties/lib/rails/tasks/documentation.rake +++ b/railties/lib/rails/tasks/documentation.rake @@ -1,10 +1,4 @@ -begin - require 'rdoc/task' -rescue LoadError - require 'rdoc/rdoc' - require 'rake/rdoctask' - RDoc::Task = Rake::RDocTask -end +require 'rdoc/task' # Monkey-patch to remove redoc'ing and clobber descriptions to cut down on rake -T noise class RDocTaskWithoutDescriptions < RDoc::Task |