Module: Bisu::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/bisu/config.rb

Instance Method Summary collapse

Instance Method Details

#parse(file_name) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/bisu/config.rb', line 7

def parse(file_name)
  unless file_name
    Logger.error("Config file not provided")
    return nil
  end

  unless File.exists?(file_name)
    Logger.error("Could not find config file #{file_name}")
    return nil
  end

  begin
    deep_sym(YAML::load_file(file_name))
  rescue Exception => e
    Logger.error("Could not parse config file #{file_name}: #{e}")
    return nil
  end
end