Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make flog operate on strings #17

Closed
wants to merge 1 commit into from

Conversation

adamsanderson
Copy link

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.

@ghost ghost assigned zenspider Dec 17, 2012
@zenspider
Copy link
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.

@zenspider
Copy link
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.

Thanks

@zenspider zenspider closed this Dec 18, 2012
@adamsanderson
Copy link
Author

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

@seattlerb seattlerb locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants