gjtorikian/html-proofer — pull request #6 by benbalter (2013-10-12 00:10:08+00:00)
Title: Refactor

After digging around in the code a bit, it struck me that quadruple nested if loops may not be the bets way to go. This pull request refactors the link and images checkers for better relative URL support while also cleaning up the logic. As a result, several of the existing tests now properly fail, which required the creation of `spec/html/proofer/fixtures/brokenInternalLink.html`, `spec/html/proofer/fixtures/folder/anchorLink.html`, and `spec/html/proofer/fixtures/notarealhash.html`, the modification of `spec/html/proofer/fixtures/brokenLinkWithNumber.html`, and the removal of `spec/html/proofer/fixtures/missingImageDirPrefix.html`.

Specifically, it creates a `Checkable` class, which is extended and instantiated as `Link` and `Image`, with proper object oriented methods for the various checks.

Not sure if this is the best way to do things, and could probably use some clean up down the line, but believe the logic in the checks is now significantly clearer and was able to expose additional edge cases otherwise unhanded.

Thanks for a great, incredibly useful Gem. Looking forward to using it on my personal site.