Method: Juli::Util::Config#initialize

Defined in:
lib/juli/util.rb

#initializeConfig

Returns a new instance of Config.



143
144
145
146
147
148
149
150
151
152
# File 'lib/juli/util.rb', line 143

def initialize
  path  = File.join(Juli::Util::juli_repo, Juli::REPO, 'config')
  hash  = File.exist?(path) ?
      YAML::load(ERB.new(File.read(path)).result) :
      {}

  # YAML::load('') returns false so that set empty hash
  hash = {} if hash == false
  @conf = DEFAULT.dup.merge(hash)
end