Browse files

Make `rake doc:guides` works again. Fix #10384.

Conflicts:
	railties/guides/rails_guides.rb
	railties/lib/rails/tasks/documentation.rake
  • Loading branch information...
1 parent 5f8a7d1 commit 946ad5d9f92af5295305069c4549de79501bdcaa @siong1987 siong1987 committed with steveklabnik Apr 30, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 railties/guides/rails_guides.rb
  2. +2 −2 railties/lib/rails/tasks/documentation.rake
View
2 railties/guides/rails_guides.rb
@@ -25,7 +25,7 @@ def bundler?
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?
View
4 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

0 comments on commit 946ad5d

Please sign in to comment.