Method: What::Config.load_secondary

Defined in:
lib/what/config.rb

.load_secondary(fns) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/what/config.rb', line 25

def self.load_secondary(fns)
  return if !fns

  fns.each do |fn|
    path = if fn.match(%r(^/))
             fn
           else
             File.join(@config['base'], fn)
           end
    begin
      opts = YAML.load_file(path)
      @config.merge!(opts)
    rescue Exception => e
      puts "Error loading config file #{path}: #{e}"
    end
  end
end