Skip to content

Instantly share code, notes, and snippets.

@burningTyger
Created June 18, 2011 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burningTyger/1032625 to your computer and use it in GitHub Desktop.
Save burningTyger/1032625 to your computer and use it in GitHub Desktop.
rbx bug in IO#lineno
counter={}
File.open('lines.txt', 'r') do |f|
f.each_line do |l|
counter[f.lineno] = l
end
end
counter.each_pair {|k,v| puts "#{k}: #{v}"}
#where lines.txt is
#1
#2
#3
#4
#5
#6
#7
#8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment