Class: AMI::ConfigLoader
- Inherits:
-
Object
- Object
- AMI::ConfigLoader
- Defined in:
- lib/ami/config_loader.rb
Class Method Summary collapse
Class Method Details
.load_config ⇒ Object
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.('~/.ami/config.json')) raw_config.merge!(JSON.load(File.open(File.('~/.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 |