aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeng Siong Ong <siong1987@gmail.com>2013-04-30 06:49:03 -0700
committerSteve Klabnik <steve@steveklabnik.com>2013-08-05 16:02:17 -0400
commit946ad5d9f92af5295305069c4549de79501bdcaa (patch)
tree706d5b2e1fb7574cf35a265f51aff6a1344a2c21
parent5f8a7d1d4d867d87e74b378d357f8476f91e7852 (diff)
downloadrails-946ad5d9f92af5295305069c4549de79501bdcaa.tar.gz
rails-946ad5d9f92af5295305069c4549de79501bdcaa.tar.bz2
rails-946ad5d9f92af5295305069c4549de79501bdcaa.zip
Make `rake doc:guides` works again. Fix #10384.
Conflicts: railties/guides/rails_guides.rb railties/lib/rails/tasks/documentation.rake
-rw-r--r--railties/guides/rails_guides.rb2
-rw-r--r--railties/lib/rails/tasks/documentation.rake4
2 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/rails_guides.rb b/railties/guides/rails_guides.rb
index feb5fe3937..524299fb68 100644
--- a/railties/guides/rails_guides.rb
+++ b/railties/guides/rails_guides.rb
@@ -25,7 +25,7 @@ end
begin
require 'redcloth'
-rescue Gem::LoadError
+rescue LoadError
# This can happen if doc:guides is executed in an application.
$stderr.puts('Generating guides requires RedCloth 4.1.1+.')
$stderr.puts(<<ERROR) if bundler?
diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake
index 1760f526e3..648af722f8 100644
--- a/railties/lib/rails/tasks/documentation.rake
+++ b/railties/lib/rails/tasks/documentation.rake
@@ -120,8 +120,8 @@ namespace :doc do
# desc "Generate Rails Guides"
task :guides do
- # FIXME: Reaching outside lib directory is a bad idea
- require File.expand_path('../../../../guides/rails_guides', __FILE__)
+ rails_gem_dir = Gem::Specification.find_by_name("rails").gem_dir
+ require File.expand_path(File.join(rails_gem_dir, "railties/guides/rails_guides"))
RailsGuides::Generator.new(Rails.root.join("doc/guides")).generate
end