timsutton/brew-pkg — pull request #2 by antifuchs (2014-05-07 21:32:26+00:00)
Title: Include a formula's revision in its version number

Absent any helper methods, I think this is about right - if you want to split this out into something that's easier to read, I can think of a few refactorings that would probably help (: