4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/modables_dsl/config.rb', line 4
def self.get
if @config.nil?
@config = {
'dsl' => {
'ext_json' => 'mo.json',
'stack_dirs' => Array.new,
}
}
config_file = ModablesDSL::Cli.opts['config'] || "#{ENV['HOME']}/.modables.yaml"
if File.file? config_file
ModablesDSL::Message.log.info "Loading config #{config_file}"
@config.deep_merge!(YAML.load_file(config_file))
elsif ModablesDSL::Cli.opts['config']
ModablesDSL::Message.error "Config file #{config_file} not found"
exit 1
end
end
@config
end
|