From: Austin Ziegler Date: 2004-08-05T02:46:14+09:00 Subject: Re: YAML.load(ARGF) On Thu, 5 Aug 2004 02:36:29 +0900, Hans Fugal wrote: > Consider these two short programs: > ARGF.read > and > require 'yaml' > YAML.load(ARGF) > > Then call them like so: > > $ ruby foo.rb foo > > The first program prints the contents of foo and exits. The second > program waits for ^D from the terminal, and then tries to parse the YAML > and go on with life. > > I want ARGF to behave like it does in the first example, in the second > example. Of course I could do YAML.load(ARGF.read) but that doesn't > satisfy my curiousity. :-) IMO, YAML.load *should* do this with ARGF because the following works: f = File.open("foo", "rb") YAML.load(f) f.close -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca