Skip to content

Instantly share code, notes, and snippets.

@jeremy
Forked from evizitei/better_file_iteration.rb
Created June 5, 2009 04:29
Show Gist options
  • Save jeremy/124054 to your computer and use it in GitHub Desktop.
Save jeremy/124054 to your computer and use it in GitHub Desktop.
# $/ is the ruby line separator, defaults to \n
$/ = '~'
File.open('some_file') do |file|
file.each_line do |line|
# ...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment