i.e. not from current directory, but without specifying its path.
Also, and i haven’t even bothered to test this, but if it’s similar to
PHP’s FILE variable, it’s the current file… so require a file, call
a
method in that file, and access FILE in that method and you’re gonna
get your required file, not the initial one…
Looks like out of the originally invoked rb script, the whole path is
lost. I would have to assign the value to a global variable if I
needed to preserve it to all scripts.
Not necessarily… when running a script under rcov or similar, they
may differ (for example one starts with ./ while the other does not).
That’s why I write the if FILE == $0 idiom as
if File.expand_path(FILE) == File.expand_path($0)
Another possibility might be is when you start the script using $PATH,
i.e. not from current directory, but without specifying its path.