From adef7e865ca2f4f793357abc96e17595325205ee Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 12 Jan 2024 14:45:16 -0500 Subject: [PATCH 1/4] Allow rails 7 gems in gemspec --- inventory_refresh.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From ddd792e65446616672f0c6acb93f3755dcd12123 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 12 Jan 2024 16:50:58 -0500 Subject: [PATCH 2/4] Add rails 7 to the test matrix --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0787ed42..4c2cfbbc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,9 @@ jobs: - '3.0' 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' From 20bb846afc288a9320a6573a4f965f3ddea460ed Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 12 Jan 2024 16:54:07 -0500 Subject: [PATCH 3/4] Add ruby 3.1 along with rails 7 Use safe load to test with ruby 3.1/newer psych --- .github/workflows/ci.yaml | 1 + Rakefile | 7 ++++++- spec/spec_helper.rb | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4c2cfbbc..26c028c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,6 +14,7 @@ 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 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/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"]) From be68fe71feb71cc44ed6b8ff0e87ccb0d5e2b59d Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 12 Jan 2024 17:25:03 -0500 Subject: [PATCH 4/4] Drop long since end of life ruby 2.5/rails 5.2 --- .github/workflows/ci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 26c028c7..02bfadcf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,9 +21,6 @@ jobs: - '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'