mattalxndr
mattalxndr

Reputation: 9418

The contents of `__FILE__` when code is coming from STDIN

If I run code like this, I get - in the __FILE__ var:

cat script.rb | ruby

I can't find that documented anywhere though (docs). Where can I get exact details about it?

Upvotes: 0

Views: 47

Answers (1)

Some Guy
Some Guy

Reputation: 1511

- is sometimes used to refer to STDIN. This is a unix thing, and not unique to ruby.

Described a little bit here

Upvotes: 0

Related Questions