From e6a2420e326fe29d029ffb64db7ce09e3fe9e99c Mon Sep 17 00:00:00 2001 From: Jordan Owens Date: Wed, 13 Apr 2022 21:32:01 -0400 Subject: [PATCH] Fix CI failures --- .github/workflows/test.yml | 2 +- sinatra-contrib/lib/sinatra/config_file.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0283e192..7e026ea9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0' - ruby: [2.6, 2.7, '3.0', 3.1, 'jruby-9.3'] + ruby: [2.6, 2.7, '3.0', 'jruby-9.3'] steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 diff --git a/sinatra-contrib/lib/sinatra/config_file.rb b/sinatra-contrib/lib/sinatra/config_file.rb index 701e99af..971a7943 100644 --- a/sinatra-contrib/lib/sinatra/config_file.rb +++ b/sinatra-contrib/lib/sinatra/config_file.rb @@ -124,7 +124,11 @@ module Sinatra 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 = begin + YAML.load(document, aliases: true) + rescue ArgumentError + YAML.load(document) + end config = config_for_env(yaml) config.each_pair { |key, value| set(key, value) } end