Method: StackMaster::Config.load!

Defined in:
lib/stack_master/config.rb

.load!(config_file = 'stack_master.yml') ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/stack_master/config.rb', line 8

def self.load!(config_file = 'stack_master.yml')
  resolved_config_file = search_up_and_chdir(config_file)
  config = YAML.load(File.read(resolved_config_file))
  base_dir = File.dirname(File.expand_path(resolved_config_file))
  new(config, base_dir)
rescue Psych::SyntaxError => error
  raise ConfigParseError, "Unable to parse #{resolved_config_file}: #{error}"
end