Skip to content

Instantly share code, notes, and snippets.

@jrgifford
Created August 2, 2011 11:46
Show Gist options
  • Save jrgifford/1120043 to your computer and use it in GitHub Desktop.
Save jrgifford/1120043 to your computer and use it in GitHub Desktop.
f = File.new("test.txt", "r")
catch(:end_of_file) do
loop do
throw :end_of_file if f.eof?
puts f.get
end
end
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment