From 1ff3ae3ed7eb04268ffc880d1c39ad7957a9a7f7 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 22 Mar 2009 11:11:10 +0100 Subject: ensure authors get warnings about broken links, and ensure end users don't --- railties/Rakefile | 1 + railties/guides/rails_guides/generator.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3