Method: Config.load_files

Defined in:
lib/config.rb

.load_files(*files) ⇒ Object

Create a populated Options instance from a settings file. If a second file is given, then the sections of that file will overwrite existing sections of the first file.



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/config.rb', line 38

def self.load_files(*files)
  config = Options.new

  # add settings sources
  [files].flatten.compact.uniq.each do |file|
    config.add_source!(file.to_s)
  end

  config.add_source!(Sources::EnvSource.new(ENV)) if Config.use_env

  config.load!
  config
end