From bce170cf6dbaf29f409631ebe54a3c5f8e877204 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sun, 29 Dec 2024 18:57:33 +0100 Subject: [PATCH] Test against Ruby 3.4 (#950) Additionally: return implicit `nil` from `SingletonHelpers#collection` to keep the same coverage results as 3.3 --- .github/workflows/ci.yaml | 3 + .github/workflows/rubocop.yml | 2 +- Gemfile.lock | 157 +++++++++---------- gemfiles/rails_70/Gemfile.lock | 27 ++-- gemfiles/rails_71/Gemfile.lock | 41 +++-- gemfiles/rails_72/Gemfile.lock | 41 +++-- lib/inherited_resources/singleton_helpers.rb | 4 +- 7 files changed, 136 insertions(+), 139 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5ef423f2..45dba61e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,7 @@ jobs: - "3.1" - "3.2" - "3.3" + - "3.4" rails: - rails_70 - rails_71 @@ -26,6 +27,8 @@ jobs: exclude: - ruby: "3.1" rails: rails_80 + - ruby: "3.4" + rails: rails_70 steps: - uses: actions/checkout@v4 - name: Configure bundler (default) diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 0f812349..ba6a9614 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -4,7 +4,7 @@ on: pull_request: env: - RUBY_VERSION: ${{ vars.RUBOCOP_RUBY_VERSION || '3.3' }} + RUBY_VERSION: ${{ vars.RUBOCOP_RUBY_VERSION || '3.4' }} jobs: rubocop: diff --git a/Gemfile.lock b/Gemfile.lock index 60b69cab..666f353f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,29 +10,29 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (8.0.0.1) - actionpack (= 8.0.0.1) - activesupport (= 8.0.0.1) + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0.1) - actionpack (= 8.0.0.1) - activejob (= 8.0.0.1) - activerecord (= 8.0.0.1) - activestorage (= 8.0.0.1) - activesupport (= 8.0.0.1) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) - actionmailer (8.0.0.1) - actionpack (= 8.0.0.1) - actionview (= 8.0.0.1) - activejob (= 8.0.0.1) - activesupport (= 8.0.0.1) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0.1) - actionview (= 8.0.0.1) - activesupport (= 8.0.0.1) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -40,35 +40,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0.1) - actionpack (= 8.0.0.1) - activerecord (= 8.0.0.1) - activestorage (= 8.0.0.1) - activesupport (= 8.0.0.1) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0.1) - activesupport (= 8.0.0.1) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.0.1) - activesupport (= 8.0.0.1) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (8.0.0.1) - activesupport (= 8.0.0.1) - activerecord (8.0.0.1) - activemodel (= 8.0.0.1) - activesupport (= 8.0.0.1) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) timeout (>= 0.4.0) - activestorage (8.0.0.1) - actionpack (= 8.0.0.1) - activejob (= 8.0.0.1) - activerecord (= 8.0.0.1) - activesupport (= 8.0.0.1) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - activesupport (8.0.0.1) + activesupport (8.0.1) base64 benchmark (>= 0.3) bigdecimal @@ -85,7 +85,7 @@ GEM ast (2.4.2) base64 (0.2.0) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) builder (3.3.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) @@ -93,7 +93,7 @@ GEM date (3.4.1) docile (1.4.1) drb (2.2.1) - erubi (1.13.0) + erubi (1.13.1) globalid (1.2.1) activesupport (>= 6.1) has_scope (0.8.2) @@ -102,12 +102,12 @@ GEM i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.8.0) - irb (1.14.1) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.9.0) + json (2.9.1) language_server-protocol (3.17.0.3) - logger (1.6.2) + logger (1.6.4) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -127,7 +127,7 @@ GEM ruby-progressbar mocha (2.7.1) ruby2_keywords (>= 0.0.5) - net-imap (0.5.1) + net-imap (0.5.4) date net-protocol net-pop (0.1.2) @@ -135,48 +135,47 @@ GEM net-protocol (0.2.2) timeout net-smtp (0.5.0) - net-protocol nio4r (2.7.4) - nokogiri (1.17.1) + nokogiri (1.18.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.17.1-aarch64-linux) + nokogiri (1.18.0-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.17.1-arm64-darwin) + nokogiri (1.18.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-darwin) + nokogiri (1.18.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-linux) + nokogiri (1.18.0-x86_64-linux-gnu) racc (~> 1.4) parallel (1.26.3) parser (3.3.6.0) ast (~> 2.4.1) racc - psych (5.2.1) + psych (5.2.2) date stringio racc (1.8.1) rack (3.1.8) rack-session (2.0.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rackup (2.2.1) rack (>= 3) - rails (8.0.0.1) - actioncable (= 8.0.0.1) - actionmailbox (= 8.0.0.1) - actionmailer (= 8.0.0.1) - actionpack (= 8.0.0.1) - actiontext (= 8.0.0.1) - actionview (= 8.0.0.1) - activejob (= 8.0.0.1) - activemodel (= 8.0.0.1) - activerecord (= 8.0.0.1) - activestorage (= 8.0.0.1) - activesupport (= 8.0.0.1) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) bundler (>= 1.15.0) - railties (= 8.0.0.1) + railties (= 8.0.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -185,12 +184,12 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (8.0.0.1) - actionpack (= 8.0.0.1) - activesupport (= 8.0.0.1) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -198,16 +197,16 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.8.1) + rdoc (6.10.0) psych (>= 4.0.0) - regexp_parser (2.9.3) - reline (0.5.12) + regexp_parser (2.10.0) + reline (0.6.0) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.9) - rubocop (1.69.1) + rexml (3.4.0) + rubocop (1.69.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -217,7 +216,7 @@ GEM rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.36.2) + rubocop-ast (1.37.0) parser (>= 3.3.1.0) rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) @@ -229,7 +228,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - securerandom (0.4.0) + securerandom (0.4.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -241,15 +240,15 @@ GEM simplecov_json_formatter (0.1.4) stringio (3.1.2) thor (1.3.2) - timeout (0.4.2) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.2) + unicode-display_width (3.1.3) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) uri (1.0.2) useragent (0.16.11) - warning (1.4.0) + warning (1.5.0) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -278,4 +277,4 @@ DEPENDENCIES warning BUNDLED WITH - 2.5.22 + 2.6.2 diff --git a/gemfiles/rails_70/Gemfile.lock b/gemfiles/rails_70/Gemfile.lock index f5132b53..256772e8 100644 --- a/gemfiles/rails_70/Gemfile.lock +++ b/gemfiles/rails_70/Gemfile.lock @@ -81,7 +81,7 @@ GEM crass (1.0.6) date (3.4.1) docile (1.4.1) - erubi (1.13.0) + erubi (1.13.1) globalid (1.2.1) activesupport (>= 6.1) has_scope (0.8.2) @@ -109,7 +109,7 @@ GEM ruby-progressbar mocha (2.7.1) ruby2_keywords (>= 0.0.5) - net-imap (0.5.1) + net-imap (0.5.4) date net-protocol net-pop (0.1.2) @@ -117,22 +117,21 @@ GEM net-protocol (0.2.2) timeout net-smtp (0.5.0) - net-protocol nio4r (2.7.4) - nokogiri (1.17.1) + nokogiri (1.18.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.17.1-aarch64-linux) + nokogiri (1.18.0-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.17.1-arm64-darwin) + nokogiri (1.18.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-darwin) + nokogiri (1.18.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-linux) + nokogiri (1.18.0-x86_64-linux-gnu) racc (~> 1.4) racc (1.8.1) rack (2.2.10) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rails (7.0.8.7) actioncable (= 7.0.8.7) @@ -156,7 +155,7 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) railties (7.0.8.7) @@ -170,7 +169,7 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.9) + rexml (3.4.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) simplecov (0.22.0) @@ -183,10 +182,10 @@ GEM simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) thor (1.3.2) - timeout (0.4.2) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - warning (1.4.0) + warning (1.5.0) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -212,4 +211,4 @@ DEPENDENCIES zeitwerk (~> 2.6.18) BUNDLED WITH - 2.5.22 + 2.6.2 diff --git a/gemfiles/rails_71/Gemfile.lock b/gemfiles/rails_71/Gemfile.lock index 1d8fef00..7d257ef3 100644 --- a/gemfiles/rails_71/Gemfile.lock +++ b/gemfiles/rails_71/Gemfile.lock @@ -90,7 +90,7 @@ GEM ansi (1.5.0) base64 (0.2.0) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) builder (3.3.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) @@ -98,7 +98,7 @@ GEM date (3.4.1) docile (1.4.1) drb (2.2.1) - erubi (1.13.0) + erubi (1.13.1) globalid (1.2.1) activesupport (>= 6.1) has_scope (0.8.2) @@ -107,10 +107,10 @@ GEM i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.8.0) - irb (1.14.1) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) - logger (1.6.2) + logger (1.6.4) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -131,7 +131,7 @@ GEM mocha (2.7.1) ruby2_keywords (>= 0.0.5) mutex_m (0.3.0) - net-imap (0.5.1) + net-imap (0.5.4) date net-protocol net-pop (0.1.2) @@ -139,27 +139,26 @@ GEM net-protocol (0.2.2) timeout net-smtp (0.5.0) - net-protocol nio4r (2.7.4) - nokogiri (1.17.1) + nokogiri (1.18.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.17.1-aarch64-linux) + nokogiri (1.18.0-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.17.1-arm64-darwin) + nokogiri (1.18.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-darwin) + nokogiri (1.18.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-linux) + nokogiri (1.18.0-x86_64-linux-gnu) racc (~> 1.4) - psych (5.2.1) + psych (5.2.2) date stringio racc (1.8.1) rack (3.1.8) rack-session (2.0.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rackup (2.2.1) rack (>= 3) @@ -185,7 +184,7 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) railties (7.1.5.1) @@ -197,17 +196,17 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rake (13.2.1) - rdoc (6.8.1) + rdoc (6.10.0) psych (>= 4.0.0) - reline (0.5.12) + reline (0.6.0) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.9) + rexml (3.4.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - securerandom (0.4.0) + securerandom (0.4.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -219,10 +218,10 @@ GEM simplecov_json_formatter (0.1.4) stringio (3.1.2) thor (1.3.2) - timeout (0.4.2) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - warning (1.4.0) + warning (1.5.0) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -248,4 +247,4 @@ DEPENDENCIES zeitwerk (~> 2.6.18) BUNDLED WITH - 2.5.22 + 2.6.2 diff --git a/gemfiles/rails_72/Gemfile.lock b/gemfiles/rails_72/Gemfile.lock index 7bbe2e19..efd04df0 100644 --- a/gemfiles/rails_72/Gemfile.lock +++ b/gemfiles/rails_72/Gemfile.lock @@ -84,7 +84,7 @@ GEM ansi (1.5.0) base64 (0.2.0) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) builder (3.3.0) concurrent-ruby (1.3.4) connection_pool (2.4.1) @@ -92,7 +92,7 @@ GEM date (3.4.1) docile (1.4.1) drb (2.2.1) - erubi (1.13.0) + erubi (1.13.1) globalid (1.2.1) activesupport (>= 6.1) has_scope (0.8.2) @@ -101,10 +101,10 @@ GEM i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.8.0) - irb (1.14.1) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) - logger (1.6.2) + logger (1.6.4) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -124,7 +124,7 @@ GEM ruby-progressbar mocha (2.7.1) ruby2_keywords (>= 0.0.5) - net-imap (0.5.1) + net-imap (0.5.4) date net-protocol net-pop (0.1.2) @@ -132,27 +132,26 @@ GEM net-protocol (0.2.2) timeout net-smtp (0.5.0) - net-protocol nio4r (2.7.4) - nokogiri (1.17.1) + nokogiri (1.18.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.17.1-aarch64-linux) + nokogiri (1.18.0-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.17.1-arm64-darwin) + nokogiri (1.18.0-arm64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-darwin) + nokogiri (1.18.0-x86_64-darwin) racc (~> 1.4) - nokogiri (1.17.1-x86_64-linux) + nokogiri (1.18.0-x86_64-linux-gnu) racc (~> 1.4) - psych (5.2.1) + psych (5.2.2) date stringio racc (1.8.1) rack (3.1.8) rack-session (2.0.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rackup (2.2.1) rack (>= 3) @@ -178,7 +177,7 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) railties (7.2.2.1) @@ -190,17 +189,17 @@ GEM thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rake (13.2.1) - rdoc (6.8.1) + rdoc (6.10.0) psych (>= 4.0.0) - reline (0.5.12) + reline (0.6.0) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.9) + rexml (3.4.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - securerandom (0.4.0) + securerandom (0.4.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -212,11 +211,11 @@ GEM simplecov_json_formatter (0.1.4) stringio (3.1.2) thor (1.3.2) - timeout (0.4.2) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) useragent (0.16.11) - warning (1.4.0) + warning (1.5.0) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -242,4 +241,4 @@ DEPENDENCIES zeitwerk (~> 2.6.18) BUNDLED WITH - 2.5.22 + 2.6.2 diff --git a/lib/inherited_resources/singleton_helpers.rb b/lib/inherited_resources/singleton_helpers.rb index b9622a31..8e470ba8 100644 --- a/lib/inherited_resources/singleton_helpers.rb +++ b/lib/inherited_resources/singleton_helpers.rb @@ -42,9 +42,7 @@ module SingletonHelpers # Singleton methods does not deal with collections. # - def collection - nil - end + def collection; end # Overwrites how singleton deals with resource. #