Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

require 'rake/rdoctask' if failed to require 'rdoc/task'

fixes a regression introduced by b921679
require 'rdoc/task' fails if the system RDoc version is below 2.4.2 (e.g. CRuby 1.8.7)
  • Loading branch information...
commit 84fac2072018b8fa851b4ac6917c38c54fbaf74e 1 parent ae534f2
@amatsuda amatsuda authored vijaydev committed
View
7 Rakefile
@@ -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__)
View
7 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'
View
6 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
View
7 railties/test/railties/railtie_test.rb
@@ -97,7 +97,12 @@ class MyTie < Rails::Railtie
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
View
6 railties/test/railties/shared_tests.rb
@@ -237,7 +237,11 @@ def test_rake_tasks_lib_tasks_are_loaded
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
Please sign in to comment.
Something went wrong with that request. Please try again.