fixed multiple style guide violations

This commit is contained in:
Hauke Klement
2015-02-17 10:23:01 +01:00
parent cb87870a46
commit a13d1738e2
32 changed files with 56 additions and 64 deletions

View File

@ -6,15 +6,14 @@ module CodeOcean
def read(options = {})
path = Rails.root.join('config', "#{@filename}.yml#{options[:erb] ? '.erb' : ''}")
if ::File.exists?(path)
if ::File.exist?(path)
content = options[:erb] ? YAML.load(ERB.new(::File.new(path, 'r').read).result) : YAML.load_file(path)
content[Rails.env].with_indifferent_access
else
fail(Error, "Configuration file not found: #{path}")
end
end
end
class Config::Error < RuntimeError
class Error < RuntimeError; end
end
end