class Thor::Runner
def thorfiles(relevant_to = nil)
def thorfiles(relevant_to = nil) path = Dir.pwd thorfiles = [] # Look for Thorfile or *.thor in the current directory or a parent directory, until the root while thorfiles.empty? thorfiles = Thor::Runner.globs_for(path).map {|g| Dir[g]}.flatten path = File.dirname(path) break if path == "/" end # We want to load system-wide Thorfiles first # so the local Thorfiles will override them. (relevant_to ? thorfiles_relevant_to(relevant_to) : thor_root_glob) + thorfiles - ["#{thor_root}/thor.yml"] end