From: David Rio Date: 2009-04-19T09:39:38+09:00 Subject: Re: load "/proc/self/fd/#{$stdin.fileno}" On Sat, Apr 18, 2009 at 7:00 PM, Thomas Hafner wrote: > Hello, > > the Ruby code in this article's subject works for my machine running > Ubuntu Linux, but I don't expect it to work for different operating > systems (NetBSD, FreeBSD a.s.o.). > > How can alternative OS independent Ruby code look like? Of course, it > shall also load from standard input rather than from a file. Despite > that, it shall be very close to loading a "real" file, e.g.: the line > number of the error location shall be told in case of a syntax error > within the loaded code. $ cat foo.rb eval $stdin.read $ echo "puts 'this is great' "| ruby ./foo.rb this is great