On Thu, Jul 23, 2009 at 7:30 PM, James A. Bowery<jabowery / gmail.com> wrote:
> Check this:
>
> $ cat spec/lib/plugins/filedirbug.rb
> puts File.dirname(__FILE__)
> eval("puts File.dirname(__FILE__)")
>
> $ ruby spec/lib/plugins/filedirbug.rb
> spec/lib/plugins
> .

C:\>cat test
eval("puts  __FILE__")
eval("puts File.dirname(__FILE__)")

eval("puts  __LINE__")

C:\>ruby test
(eval)
.
1

.

If you look at the source for eval, you'll see:

    char *file = "(eval)";
    int line = 1;

http://www.ruby-doc.org/core/classes/Kernel.src/M005922.html

Gordon