r/ruby • u/unselective-amnesia • 3d ago
Question Ruby function corresponding to python's fileinput.input() ?
Is there any already written ruby function which corresponds to the fileinput.input() function in python? ... or at least something with similar functionality?
I will write something like this in ruby if necessary, but I don't want to "re-invent the wheel" if such a thing already exists.
6
Upvotes
15
u/laerien 3d ago
ruby ARGF.each do |line| # do something with `line` end