class Convoy::Setup::Configuration::Locator::DescendingToHome

Public Instance Methods

locate() click to toggle source
# File lib/convoy/setup/configuration/locator/descending_to_home.rb, line 8
def locate
    return nil unless filename
    possible_configs = []
    Pathname.new(Dir.pwd).descend do |path|
        filepath = File.join(path, filename)
        if File.exists?(filepath)
            possible_configs << filepath
        end
    end
    possible_configs.empty? ? nil : possible_configs.last
end