From abbd8a34cd1d89e4cfa953bf4da9dee2e58811b3 Mon Sep 17 00:00:00 2001 From: Peter Postma Date: Sun, 10 Nov 2024 13:40:57 +0100 Subject: [PATCH] Test ActiveRecord 7.1, 7.2. and 8.0 and drop support for ancient versions. --- .github/workflows/test.yml | 79 ++++++----------- .rubocop.yml | 2 +- Gemfile | 4 +- Gemfile.lock | 84 ++++++++++++------- gemfiles/Gemfile.active_record-5.2 | 7 -- ...e_record-4.2 => Gemfile.active_record-7.1} | 4 +- ...e_record-5.0 => Gemfile.active_record-7.2} | 4 +- ...e_record-5.1 => Gemfile.active_record-8.0} | 4 +- gemfiles/Gemfile.active_record-edge | 2 +- smart_paginate.gemspec | 4 +- 10 files changed, 89 insertions(+), 105 deletions(-) delete mode 100644 gemfiles/Gemfile.active_record-5.2 rename gemfiles/{Gemfile.active_record-4.2 => Gemfile.active_record-7.1} (65%) rename gemfiles/{Gemfile.active_record-5.0 => Gemfile.active_record-7.2} (65%) rename gemfiles/{Gemfile.active_record-5.1 => Gemfile.active_record-8.0} (65%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 746f902..6905b74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,81 +9,52 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: [2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2] + ruby-version: [2.7, 3.0, 3.1, 3.2, 3.3] gemfile: - - gemfiles/Gemfile.active_record-4.2 - - gemfiles/Gemfile.active_record-5.0 - - gemfiles/Gemfile.active_record-5.1 - - gemfiles/Gemfile.active_record-5.2 - gemfiles/Gemfile.active_record-6.0 - gemfiles/Gemfile.active_record-6.1 - gemfiles/Gemfile.active_record-7.0 + - gemfiles/Gemfile.active_record-7.1 + - gemfiles/Gemfile.active_record-7.2 + - gemfiles/Gemfile.active_record-8.0 - gemfiles/Gemfile.active_record-edge exclude: - - ruby-version: 2.6 - gemfile: gemfiles/Gemfile.active_record-4.2 - - ruby-version: 2.7 - gemfile: gemfiles/Gemfile.active_record-4.2 - - ruby-version: 3.0 - gemfile: gemfiles/Gemfile.active_record-4.2 - - ruby-version: 3.1 - gemfile: gemfiles/Gemfile.active_record-4.2 - - ruby-version: 3.2 - gemfile: gemfiles/Gemfile.active_record-4.2 - - ruby-version: 2.6 - gemfile: gemfiles/Gemfile.active_record-5.0 - - ruby-version: 2.7 - gemfile: gemfiles/Gemfile.active_record-5.0 - - ruby-version: 3.0 - gemfile: gemfiles/Gemfile.active_record-5.0 - - ruby-version: 3.1 - gemfile: gemfiles/Gemfile.active_record-5.0 - - ruby-version: 3.2 - gemfile: gemfiles/Gemfile.active_record-5.0 - - ruby-version: 2.6 - gemfile: gemfiles/Gemfile.active_record-5.1 - - ruby-version: 2.7 - gemfile: gemfiles/Gemfile.active_record-5.1 - - ruby-version: 3.0 - gemfile: gemfiles/Gemfile.active_record-5.1 - - ruby-version: 3.1 - gemfile: gemfiles/Gemfile.active_record-5.1 - - ruby-version: 3.2 - gemfile: gemfiles/Gemfile.active_record-5.1 - - ruby-version: 2.7 - gemfile: gemfiles/Gemfile.active_record-5.2 - - ruby-version: 3.0 - gemfile: gemfiles/Gemfile.active_record-5.2 - - ruby-version: 3.1 - gemfile: gemfiles/Gemfile.active_record-5.2 - - ruby-version: 3.2 - gemfile: gemfiles/Gemfile.active_record-5.2 - - ruby-version: 2.4 - gemfile: gemfiles/Gemfile.active_record-6.0 - ruby-version: 3.0 gemfile: gemfiles/Gemfile.active_record-6.0 - ruby-version: 3.1 gemfile: gemfiles/Gemfile.active_record-6.0 - ruby-version: 3.2 gemfile: gemfiles/Gemfile.active_record-6.0 - - ruby-version: 2.4 + - ruby-version: 3.3 + gemfile: gemfiles/Gemfile.active_record-6.0 + - ruby-version: 3.2 gemfile: gemfiles/Gemfile.active_record-6.1 - - ruby-version: 2.4 - gemfile: gemfiles/Gemfile.active_record-7.0 - - ruby-version: 2.5 + - ruby-version: 3.3 + gemfile: gemfiles/Gemfile.active_record-6.1 + - ruby-version: 3.2 gemfile: gemfiles/Gemfile.active_record-7.0 - - ruby-version: 2.6 + - ruby-version: 3.3 gemfile: gemfiles/Gemfile.active_record-7.0 - - ruby-version: 2.4 + - ruby-version: 2.7 + gemfile: gemfiles/Gemfile.active_record-7.2 + - ruby-version: 3.0 + gemfile: gemfiles/Gemfile.active_record-7.2 + - ruby-version: 2.7 + gemfile: gemfiles/Gemfile.active_record-8.0 + - ruby-version: 3.0 + gemfile: gemfiles/Gemfile.active_record-8.0 + - ruby-version: 3.1 + gemfile: gemfiles/Gemfile.active_record-8.0 + - ruby-version: 2.7 gemfile: gemfiles/Gemfile.active_record-edge - - ruby-version: 2.5 + - ruby-version: 3.0 gemfile: gemfiles/Gemfile.active_record-edge - - ruby-version: 2.6 + - ruby-version: 3.1 gemfile: gemfiles/Gemfile.active_record-edge env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} diff --git a/.rubocop.yml b/.rubocop.yml index a63a59d..8cbf09c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 2.4 + TargetRubyVersion: 2.7 DisplayCopNames: true DisplayStyleGuide: true Exclude: diff --git a/Gemfile b/Gemfile index b43b91d..fc78e31 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,6 @@ source 'https://rubygems.org' # Specify your gem's dependencies in smart_paginate.gemspec gemspec -gem 'activerecord', '~> 7.0.4' +gem 'activerecord', '~> 8.0.0' -gem 'sqlite3', '~> 1.4' +gem 'sqlite3', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index 2be1a25..3f1bf5f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,47 +2,64 @@ PATH remote: . specs: smart_paginate (0.2.3) - activerecord (>= 4.2.0) + activerecord (>= 6.0.0) GEM remote: https://rubygems.org/ specs: - activemodel (7.0.4.1) - activesupport (= 7.0.4.1) - activerecord (7.0.4.1) - activemodel (= 7.0.4.1) - activesupport (= 7.0.4.1) - activesupport (7.0.4.1) - concurrent-ruby (~> 1.0, >= 1.0.2) + activemodel (8.0.0) + activesupport (= 8.0.0) + activerecord (8.0.0) + activemodel (= 8.0.0) + activesupport (= 8.0.0) + timeout (>= 0.4.0) + activesupport (8.0.0) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) ast (2.4.2) - concurrent-ruby (1.2.2) - diff-lcs (1.5.0) - i18n (1.14.1) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.8) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + diff-lcs (1.5.1) + drb (2.2.1) + i18n (1.14.6) concurrent-ruby (~> 1.0) - minitest (5.17.0) - parallel (1.23.0) - parser (3.2.2.1) + logger (1.6.1) + minitest (5.25.1) + parallel (1.26.3) + parser (3.3.6.0) ast (~> 2.4.1) + racc + racc (1.8.1) rainbow (3.1.1) - rake (13.0.1) - regexp_parser (2.8.0) - rexml (3.2.5) + rake (13.2.1) + regexp_parser (2.9.2) + rexml (3.3.9) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) + rspec-core (3.12.3) rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-expectations (3.12.4) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.7) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-support (3.12.0) + rspec-support (3.12.2) rubocop (1.12.1) parallel (~> 1.10) parser (>= 3.0.0.0) @@ -52,9 +69,9 @@ GEM rubocop-ast (>= 1.2.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-performance (1.18.0) + rubocop-ast (1.34.1) + parser (>= 3.3.1.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rake (0.6.0) @@ -63,16 +80,19 @@ GEM rubocop (~> 1.0) rubocop-ast (>= 1.1.0) ruby-progressbar (1.13.0) - sqlite3 (1.4.2) - tzinfo (2.0.5) + securerandom (0.3.1) + sqlite3 (2.2.0-x86_64-darwin) + timeout (0.4.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) + unicode-display_width (2.6.0) + uri (1.0.1) PLATFORMS - ruby + x86_64-darwin-23 DEPENDENCIES - activerecord (~> 7.0.4) + activerecord (~> 8.0.0) bundler (>= 1.12) rake (~> 13.0) rspec (~> 3.12.0) @@ -81,7 +101,7 @@ DEPENDENCIES rubocop-rake rubocop-rspec smart_paginate! - sqlite3 (~> 1.4) + sqlite3 (~> 2.0) BUNDLED WITH - 2.2.33 + 2.5.16 diff --git a/gemfiles/Gemfile.active_record-5.2 b/gemfiles/Gemfile.active_record-5.2 deleted file mode 100644 index be4fb91..0000000 --- a/gemfiles/Gemfile.active_record-5.2 +++ /dev/null @@ -1,7 +0,0 @@ -source 'https://rubygems.org' - -# Specify your gem's dependencies in smart_paginate.gemspec -gemspec path: '..' - -gem 'activerecord', '~> 5.2.0' -gem 'sqlite3', '~> 1.3.13' diff --git a/gemfiles/Gemfile.active_record-4.2 b/gemfiles/Gemfile.active_record-7.1 similarity index 65% rename from gemfiles/Gemfile.active_record-4.2 rename to gemfiles/Gemfile.active_record-7.1 index e538d7a..cc80ad3 100644 --- a/gemfiles/Gemfile.active_record-4.2 +++ b/gemfiles/Gemfile.active_record-7.1 @@ -3,5 +3,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in smart_paginate.gemspec gemspec path: '..' -gem 'activerecord', '~> 4.2.0' -gem 'sqlite3', '~> 1.3.13' +gem 'activerecord', '~> 7.1.0' +gem 'sqlite3', '~> 1.4.2' diff --git a/gemfiles/Gemfile.active_record-5.0 b/gemfiles/Gemfile.active_record-7.2 similarity index 65% rename from gemfiles/Gemfile.active_record-5.0 rename to gemfiles/Gemfile.active_record-7.2 index 46c2d18..e4003e3 100644 --- a/gemfiles/Gemfile.active_record-5.0 +++ b/gemfiles/Gemfile.active_record-7.2 @@ -3,5 +3,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in smart_paginate.gemspec gemspec path: '..' -gem 'activerecord', '~> 5.0.0' -gem 'sqlite3', '~> 1.3.13' +gem 'activerecord', '~> 7.2.0' +gem 'sqlite3', '~> 2.2.0' diff --git a/gemfiles/Gemfile.active_record-5.1 b/gemfiles/Gemfile.active_record-8.0 similarity index 65% rename from gemfiles/Gemfile.active_record-5.1 rename to gemfiles/Gemfile.active_record-8.0 index d164fbd..2a38488 100644 --- a/gemfiles/Gemfile.active_record-5.1 +++ b/gemfiles/Gemfile.active_record-8.0 @@ -3,5 +3,5 @@ source 'https://rubygems.org' # Specify your gem's dependencies in smart_paginate.gemspec gemspec path: '..' -gem 'activerecord', '~> 5.1.0' -gem 'sqlite3', '~> 1.3.13' +gem 'activerecord', '~> 8.0.0' +gem 'sqlite3', '~> 2.2.0' diff --git a/gemfiles/Gemfile.active_record-edge b/gemfiles/Gemfile.active_record-edge index d76a029..ff32838 100644 --- a/gemfiles/Gemfile.active_record-edge +++ b/gemfiles/Gemfile.active_record-edge @@ -4,4 +4,4 @@ source 'https://rubygems.org' gemspec path: '..' gem 'activerecord', git: 'https://github.com/rails/rails.git' -gem 'sqlite3', '~> 1.4.2' +gem 'sqlite3', '~> 2.2.0' diff --git a/smart_paginate.gemspec b/smart_paginate.gemspec index 79fa95a..3e2fac9 100644 --- a/smart_paginate.gemspec +++ b/smart_paginate.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.4.0' + spec.required_ruby_version = '>= 2.7.0' spec.add_development_dependency 'bundler', '>= 1.12' spec.add_development_dependency 'rake', '~> 13.0' @@ -32,5 +32,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop-rake' spec.add_development_dependency 'rubocop-rspec' - spec.add_dependency 'activerecord', '>= 4.2.0' + spec.add_dependency 'activerecord', '>= 6.0.0' end