class Thor::Runner

def thorfiles(relevant_to=nil, skip_lookup=false)


5. c:\ <-- no Thorfiles found!
4. c:\Documents and Settings
3. c:\Documents and Settings\james
2. c:\Documents and Settings\james\dev
1. c:\Documents and Settings\james\dev\thor

Suppose we start at c:\Documents and Settings\james\dev\thor ...

3. /Users/wycats <-- we find a Thorfile here, so we stop
2. /Users/wycats/dev
1. /Users/wycats/dev/thor

If we start at /Users/wycats/dev/thor ...

==== Example

Thorfiles can override them.
We also ensure that system-wide Thorfiles are loaded first, so local

directory of your system. If at any time we find a Thor file, we stop.
Finds Thorfiles by traversing from your current directory down to the root
def thorfiles(relevant_to=nil, skip_lookup=false)
  # Deal with deprecated thor when :namespaces: is available as constants
  save_yaml(thor_yaml) if Thor::Util.convert_constants_to_namespaces(thor_yaml)
  thorfiles = []
  unless skip_lookup
    Pathname.pwd.ascend do |path|
      thorfiles = Thor::Util.globs_for(path).map { |g| Dir[g] }.flatten
      break unless thorfiles.empty?
    end
  end
  files  = (relevant_to ? thorfiles_relevant_to(relevant_to) : Thor::Util.thor_root_glob)
  files += thorfiles
  files -= ["#{thor_root}/thor.yml"]
  files.map! do |file|
    File.directory?(file) ? File.join(file, "main.thor") : file
  end
end