8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/nclient/service_config.rb', line 8
def self.load_services!(config_file = SERVICE_CONFIG_FILE)
service_configs = YAML.load(File.read(SERVICE_CONFIG_FILE))
@@services.merge!(service_configs[Rails.env])
if (common_parts = service_configs['common']).is_a?(Hash)
common_parts.each do |k, v|
@@services[k] = if v.is_a?(Array)
if v.size == 2
v[0] = @@services[v[0].to_sym]
Ns::Util.concat_url(v[0], v[1])
else
raise "Invalid path!"
end else
v
end end end @@services
end
|