diff --git a/railties/Rakefile b/railties/Rakefile index 6c0fc22629..a9adbda0b5 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -247,6 +247,7 @@ end desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"' task :guides do + ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this ruby "guides/rails_guides.rb" end diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index 9046b9203e..7807c2c565 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -164,7 +164,7 @@ module RailsGuides guess = anchors.min { |a, b| Levenshtein.distance(fragment_identifier, a) <=> Levenshtein.distance(fragment_identifier, b) } - puts "*** BROKEN LINK: ##{fragment_identifier}, perhaps you meant ##{guess}." + puts "*** BROKEN LINK: ##{fragment_identifier}, perhaps you meant ##{guess}." if ENV.key?("WARN_BROKEN_LINKS") end end end