Skip to content

Commit

Permalink
ensure authors get warnings about broken links, and ensure end users …
Browse files Browse the repository at this point in the history
…don't
  • Loading branch information
fxn committed Mar 22, 2009
1 parent dab7813 commit 1ff3ae3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions railties/Rakefile
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion railties/guides/rails_guides/generator.rb
Expand Up @@ -164,7 +164,7 @@ def check_fragment_identifiers(html, anchors)
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
Expand Down

0 comments on commit 1ff3ae3

Please sign in to comment.