Make flog operate on strings #17

wants to merge 1 commit into


None yet

2 participants


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.

@zenspider zenspider was assigned Dec 17, 2012
Seattle Ruby Brigade member

I gotta say... something about this bugs me... I think it is that the rescue isn't pushed down, but ... yeah. words are hard.

Seattle Ruby Brigade member

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 zenspider closed this Dec 18, 2012

@zenspider thanks for making the changes. I had a similar impulse, but I figured this would make for a smaller diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment