Apply automatic rubocop fixes
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module CodeOcean
|
||||
class Config
|
||||
def initialize(filename)
|
||||
@ -7,10 +9,10 @@ module CodeOcean
|
||||
def read(options = {})
|
||||
path = Rails.root.join('config', "#{@filename}.yml#{options[:erb] ? '.erb' : ''}")
|
||||
if ::File.exist?(path)
|
||||
content = options[:erb] ? YAML.load(ERB.new(::File.new(path, 'r').read).result) : YAML.load_file(path)
|
||||
content = options[:erb] ? YAML.safe_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}")
|
||||
raise Error.new("Configuration file not found: #{path}")
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user