nobu.nokada
5/9/2005 3:12:00 PM
Hi,
At Fri, 6 May 2005 23:05:16 +0900,
Ara.T.Howard@noaa.gov wrote in [ruby-talk:141405]:
> > [ruby-dev:26079] absolute path in $LOADED_FEATURES
> >
> > Nobu.Nakada fixed __FILE__ to use absolute path.
>
> then does $0 too? otherwise
>
> if $0 == __FILE__
> ...
> end
>
> will fail
No, it is only for `require'd files.
$ echo 'p $0, __FILE__' > x.rb
$ ruby x.rb
"x.rb"
"x.rb"
$ ruby -e 'load("x.rb")'
"-e"
"./x.rb"
$ ruby -e 'require("x.rb")'
"-e"
"/home/nakada/src/ruby/trunk/x.rb"
$ ruby -rx -ep
"-e"
"/home/nakada/src/ruby/trunk/x.rb"
--
Nobu Nakada