jeremy (owner)

Fork Of

Revisions

  • 502a19 jeremy Thu Jun 04 21:35:32 -0700 2009
  • 823c5d evizitei Thu Jun 04 16:19:47 -0700 2009
gist: 124054 Download_button fork
public
Public Clone URL: git://gist.github.com/124054.git
Embed All Files: show embed
better_file_iteration.rb #
1
2
3
4
5
6
7
# $/ is the ruby line separator, defaults to \n
$/ = '~'
File.open('some_file') do |file|
  file.each_line do |line|
     # ...
  end
end