8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/torpedo/config.rb', line 8
def self.load_configs
return @@configs if not @@configs.nil?
config_file=ENV['TORPEDO_CONFIG_FILE']
if config_file.nil? then
config_file=ENV['HOME']+File::SEPARATOR+".torpedo.conf"
if not File.exists?(config_file) then
config_file="/etc/torpedo.conf"
end
end
if File.exists?(config_file) then
configs = YAML.load_file(config_file) || {}
@@configs = configs
else
raise "Failed to load torpedo config file. Please configure /etc/torpedo.conf or create a .torpedo.conf config file in your HOME directory."
end
@@configs
end
|