Created
June 4, 2009 23:19
-
-
Save evizitei/123924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class File | |
def uber_gets(delimiter) | |
segment = "" | |
self.each_byte do |byte| | |
char = byte.chr | |
if char == delimiter | |
yield segment | |
segment = "" | |
else | |
segment = "#{segment}#{char}" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment