Class: Mogwai::Config

Inherits:
Hash
  • Object
show all
Defined in:
lib/mogwai.rb

Instance Method Summary collapse

Instance Method Details

#readObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mogwai.rb', line 8

def read 
  CONFIG_PATHS.each do |path|
    if File.exists? path
      config = YAML.load_file path
      config.each_pair do |key, value|
        self[key.upcase.to_sym] = value
      end
      return
    end
  end
  raise "No Mogfile found. Please make sure you have a Mogfile present."
end