Class: Emory::ConfigurationFile

Inherits:
Object
  • Object
show all
Defined in:
lib/emory/configuration_file.rb

Constant Summary collapse

LOGGER =
Logging.logger[self]
CONFIG_FILE_NAME =
".emory"

Class Method Summary collapse

Class Method Details

.locateObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/emory/configuration_file.rb', line 15

def locate
  Pathname.new(Dir.pwd).ascend do |dir|
    LOGGER.debug "Examining directory: #{dir}"
    config_file = File.join(dir, CONFIG_FILE_NAME)
    next unless File.exists?(config_file)
    LOGGER.info "Found config file: #{config_file}"
    return config_file
  end

  raise EmoryConfigurationFileNotFoundException, 'Configuration file (.emory) was not found'
end