Skip to content

Instantly share code, notes, and snippets.

@0livier
Last active December 12, 2015 02:48
Show Gist options
  • Save 0livier/4701176 to your computer and use it in GitHub Desktop.
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]
#!/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