On Mon, Sep 28, 2009 at 11:54 AM, xiong ai <redmine / ruby-lang.org> wrote:
> Issue #1961 has been updated by xiong ai.
>
>
> (1) add a toplevel constant __DIR__
> +1
> when you type "__DIR__",you type "shift __DIR__".
> when you type "__dir__",you type "shift __[release shift] dir shift __"
> so,I prefer __DIR__ than __dir__
> thanks
> ----------------------------------------
> http://redmine.ruby-lang.org/issues/show/1961
>
> ----------------------------------------
> http://redmine.ruby-lang.org
>
>

I would be for __DIR__ for the ease of writing and because it
resembles __FILE__, neither would be constants if we take into account
that leading underscore is not a valid character for constants.
But whatever name will be chosen, it would be nice if __dir__ could
take arguments that are passed to File::expand_path.
A possible implementation is:
http://github.com/manveru/ramaze/blob/master/lib/ramaze/snippets/object/__dir__.rb

-- 
Michael Fellinger