I broke out the method actually responsible for doing the flogging from the method responsible for reading in the ruby source. This is a little bit cleaner, and makes it easier to use Flog with arbitrary content.
In my specific case I wanted to call Flog as a library, but couldn't always pass in a file path, and although you could hack around with $stdin, I think this is cleaner.
Break out Flog#flog_ruby so that you can flog strings without manipul…
I gotta say... something about this bugs me... I think it is that the rescue isn't pushed down, but ... yeah. words are hard.
OK. I went a bit overboard here. I guess today is yak shaving day... I refactored all the error handling code into #flog_ruby and all the processing meat into #flog_ruby!. This allows you to bypass the error handling if you want to, but use it if you don't.
@zenspider thanks for making the changes. I had a similar impulse, but I figured this would make for a smaller diff.