Created
July 4, 2011 12:30
-
-
Save betawaffle/1063284 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Helpers | |
def each_ln(filename) | |
File.open filename, 'r' do |f| | |
ln = 0 # Line Number | |
begin | |
while l = f.gets | |
l.strip! | |
ln += 1 | |
yield l, ln | |
end | |
rescue Interrupt | |
perr :cr, red('Interrupted') | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment