Skip to content

Instantly share code, notes, and snippets.

@evizitei
Created June 4, 2009 23:19
Show Gist options
  • Save evizitei/123924 to your computer and use it in GitHub Desktop.
Save evizitei/123924 to your computer and use it in GitHub Desktop.
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