-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add each_line enumerator to IO class #10
base: master
Are you sure you want to change the base?
Conversation
fbe0b4e
to
59eb99b
Compare
In the Ruby IO object, each_line takes the line separator and limit as arguments. Would that be possible to include here? |
I ran into trouble with this, and the only way around it seems to be to use the My goal here is to be able to take a lazy enumerator (like you'd use for an infinite sequence) and use it to create an infinitely long IO stream. In other words, to drive a stream of bytes from a generator function. The problem I'm running into here is that either I implement it as a lazy enumerator (which causes But yes, if I can find away around that, I'd add those other methods. Do you have any ideas for how to accomplish this? The last thing I tried was to create a child class of |
I found a solution to this while developing an unrelated project: use |
a51c4ae
to
1be2c16
Compare
1be2c16
to
466417e
Compare
I worked around your suggestion by yielding a literal core |
This enables the following: