From: Nikolai Weibull Date: 2008-10-14T04:20:18+09:00 Subject: [ruby-core:19319] Re: [Feature #643] __DIR__ On Mon, Oct 13, 2008 at 21:08, Ryan Davis wrote: > On Oct 13, 2008, at 11:27 , Thomas Sawyer wrote: > I frequently need to do: > > File.dirname(File.dirname(__FILE__)) I realize that I'm responding to a joke, but wouldn't it perhaps be nice if File.dirname took an optional second argument that allowed you to specify how many levels up you want to go? I actually implemented this at work, simply because I was doing a lot of nested File.dirname calls.