Skip to content

Commit

Permalink
fix(sinatra-contrib): config file loading with ruby 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach authored and jkowens committed Feb 2, 2022
1 parent 60e2219 commit b0fa4be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def config_file(*paths)
raise UnsupportedConfigType unless ['.yml', '.yaml', '.erb'].include?(File.extname(file))
logger.info "loading config file '#{file}'" if logging? && respond_to?(:logger)
document = ERB.new(IO.read(file)).result
yaml = YAML.load(document)
yaml = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(document) : YAML.load(document)
config = config_for_env(yaml)
config.each_pair { |key, value| set(key, value) }
end
Expand Down

0 comments on commit b0fa4be

Please sign in to comment.