Class: Indocker::Configs::Locator

Inherits:
Object
  • Object
show all
Includes:
SmartIoC::Iocify
Defined in:
lib/indocker/configs/locator.rb

Constant Summary collapse

ROOT =
'/'

Instance Method Summary collapse

Instance Method Details

#locate(path) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/indocker/configs/locator.rb', line 8

def locate(path)
  expand_path = potential_config_file File.expand_path(path)
  
  return expand_path if File.exists?(expand_path)
  
  raise Indocker::Errors::ConfigFilesDoesNotFound if path == ROOT

  locate(File.dirname(path))
end