Class: Escort::Setup::Configuration::Locator::DescendingToHome
- Defined in:
- lib/escort/setup/configuration/locator/descending_to_home.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Escort::Setup::Configuration::Locator::Base
Instance Method Details
#locate ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/escort/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 |