Permalink
Browse files

Merge pull request #1301 from amatsuda/require_rdoc_task_fail

require 'rake/rdoctask' if failed to require 'rdoc/task'
  • Loading branch information...
fxn committed May 25, 2011
2 parents f116a48 + 24b28a2 commit ee46bb73d44338b7dfb8976cc59d742b9394148a
View
@@ -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__)
@@ -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'
@@ -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
@@ -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
@@ -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

0 comments on commit ee46bb7

Please sign in to comment.