From: Tony Arcieri Date: 2010-06-24T08:02:25+09:00 Subject: Re: Finding a project's root directory --000e0cd23bcc7784940489ba8701 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jun 23, 2010 at 12:43 PM, Intransition wrote: > As I continue to work project development tools I repeatedly run into > the case of needing a reliable way to identify the project's root > directory, i.e. to ascend up the directories until it is found. > > So far the best idea of come up with is to look for .git/, .hg/ or as > a fallback, README*. In cases where I actually need this, I usually have a "root" method defined on the class/module that represents the project. This is usually calculated from __FILE__ based off the file where the "root" method is defined. I prefer to have this be the only usage of __FILE__ in the entire project, if possible. -- Tony Arcieri Medioh! A Kudelski Brand --000e0cd23bcc7784940489ba8701--