Last active
December 12, 2015 02:48
-
-
Save 0livier/4701176 to your computer and use it in GitHub Desktop.
Testing ARGV/ARGF under several rubies. Not working with ruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_26-b03 [linux-amd64]
This file contains 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
#!/usr/bin/env ruby | |
def foo(fh) | |
until fh.eof? | |
puts fh.readline | |
end | |
end | |
ARGV.replace [__FILE__] | |
foo(ARGF) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment