6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/services/config_service.rb', line 6
def load_config(config_file_name)
app_root = (defined? APP_ROOT)? APP_ROOT : File.expand_path('.')
config_file = nil
['conf', 'config'].each do |sub_path|
if File.exist?("#{app_root}/#{sub_path}/#{config_file_name}")
config_file = "#{app_root}/#{sub_path}/#{config_file_name}"
break
end
end
raise("You must have the file #{config_file_name} in either 'conf' or 'config' directory of your application") unless config_file
YAML.load_file(config_file)
end
|