5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/cluster_point/configuration.rb', line 5
def load_config
@file = (Rails.root ? Rails.root.to_s : ".") + "/config/cluster_point.yml"
@env = DEFAULT_ENV.call.to_s
if !File.exists?(@file)
raise ConfigurationNotFound
end
begin
data = YAML.load_file(@file)
rescue ArgumentError, Psych::SyntaxError => error
raise Fixture::FormatError, "a YAML error occurred parsing #{@file}. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html\nThe exact error was:\n #{error.class}: #{error}", error.backtrace
end
if !data.has_key?(@env)
raise ConfigurationNotFound
end
@config = data[@env]
self.class.base_uri get_base_uri(@config)
if @config["debug_output"]
self.class.debug_output $stdout
end
end
|