From: Trans Date: 2008-10-14T23:47:33+09:00 Subject: [ruby-core:19330] Re: [Feature #643] __DIR__ On Oct 13, 6:02�pm, Dave Thomas wrote: > On Oct 13, 2008, at 4:51 PM, Phil Hagelberg wrote: > > > If we don't want to add another toplevel constant, another way to � > > handle > > this gracefully would be to have the default argument for File.dirname > > be the caller's __FILE__. At least 90% of the File.dirname invocations > > that I write have __FILE__ as their argument, so this would remove a > > good deal of redundancy. > > But with relative_require, suddenly most of those use cases evaporate, � > no? Pretty much, but it would take a #relative_load and a File.relative_read to really cover all common uses. But there are always those outlay cases too. The thing about __DIR__ is that it is generally useful for all cases, whereas #relative_require has a single specific use. T.