Hi,
In message "Re: [ruby-core:24982] [Feature #1961] Kernel#__dir__"
on Wed, 19 Aug 2009 23:57:07 +0900, Yutaka HARA <redmine / ruby-lang.org> writes:
|= Proposal
|
| Kernel#__dir__
| returns the value of File.dirname(__FILE__)
|
|According to the google code search, about 60% of uses of __FILE__
|are of the form File.dirname(__FILE__). Ruby 1.9.2 provides
|require_relative for this problem; but File.dirname(__FILE__) is
|not always used for requiring ruby scripts, but also for reading
|data files. __dir__ helps these cases.
I accept the proposal. If a patch comes, I'd love to merge it in.
matz.