ruhoh/ruhoh.rb — pull request #97 by NSError (2012-10-01 21:30:23+00:00)
Title: Fix for trailing slashes issue

Adds a toggle ability to have a trailing slash in all URLs.

This solves an issue when Ruhoh-generated sites are served via Apache. Ruhoh's lack of trailing slashes causes Apache to generate redirects by default to force a valid URL. This creates a lot of redirects in normal use, and also breaks category and tag links because Apache's redirects do not keep the hash values.

For example, Ruhoh might generate the URL `http://example.com/tags#tag-ref`, which Apache will redirect to `http://example.com/tags/`. However, on servers which aren't encumbered by Apache's behavior, the convention of omitting the trailing slash is preferable. For this reason, I've chosen to make this behavior configurable instead of a single "one size fits all" solution.

This also reduces the number of extraneous redirects by approximately 100% while running on my site.

I don't necessarily think this is the best way of implementing this solution. I'm interested to see what suggestions or corrections you may have to offer before this pull request is merge-able.

Thanks!