diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0787ed42..02bfadcf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,13 +14,13 @@ jobs: ruby-version: - '2.7' - '3.0' + - '3.1' rails-version: # rails 6.1 supports ruby >= 2.5 + # rails 7.0 supports ruby >= 2.7 - '6.1' + - '7.0' include: - # rails 5.2 (EOL 6/22) supports ruby < 2.7 (2.6 EOL 3/22) - - ruby-version: '2.5' - rails-version: '5.2' # rails 6.0 (security EOL 6/23?) supports ruby < 2.8 (2.7 EOL 3/23?;) - ruby-version: '2.6' rails-version: '6.0' diff --git a/Rakefile b/Rakefile index 407055ac..5a5a296b 100644 --- a/Rakefile +++ b/Rakefile @@ -20,7 +20,12 @@ namespace :spec do def connection_spec require 'yaml' - @connection_spec ||= YAML.load_file(File.join(__dir__, %w[config database.yml])) + @connection_spec ||= + if YAML.respond_to?(:safe_load) + YAML.safe_load(File.read(File.join(__dir__, %w[config database.yml])), :aliases => true) + else + YAML.load_file(File.join(__dir__, %w[config database.yml])) + end end def test_database_name diff --git a/inventory_refresh.gemspec b/inventory_refresh.gemspec index add44fda..6074e852 100644 --- a/inventory_refresh.gemspec +++ b/inventory_refresh.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.metadata['rubygems_mfa_required'] = 'true' - spec.add_dependency "activerecord", ">=5.0", "< 7.0" + spec.add_dependency "activerecord", ">=5.0", "<7.1" spec.add_dependency "more_core_extensions", ">=3.5", "< 5" spec.add_dependency "pg", "> 0" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eac0c525..467e5c98 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -28,5 +28,10 @@ puts "\e[93mUsing ActiveRecord #{ActiveRecord.version}\e[0m" require 'yaml' -connection_spec = YAML.load_file(File.join(__dir__, %w[.. config database.yml])) +connection_spec = + if YAML.respond_to?(:safe_load) + YAML.safe_load(File.read(File.join(__dir__, %w[.. config database.yml])), :aliases => true) + else + YAML.load_file(File.join(__dir__, %w[.. config database.yml])) + end ActiveRecord::Base.establish_connection(connection_spec["test"])