Class: AMI::ConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/ami/config_loader.rb

Class Method Summary collapse

Class Method Details

.load_configObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/ami/config_loader.rb', line 5

def self.load_config
  raw_config = {}
  if File.exists?(File.expand_path('~/.ami/config.json'))
    raw_config.merge!(JSON.load(File.open(File.expand_path('~/.ami/config.json'))))
  end
  if File.exists?(Dir.pwd + '/ami/config/json')
    raw_config.merge!(JSON.load(File.open(Dir.pwd + '/ami/config.json')))
  end
  Config.new(raw_config)
end