From e01d82a6c7cd806c189339eab36633788adfebac Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 10 Oct 2023 20:08:30 -0300 Subject: [PATCH] Add support for Rails 7.1 --- .github/workflows/test.yml | 5 + CHANGELOG.md | 1 + Gemfile | 4 +- Gemfile.lock | 144 ++++++++++++-------- gemfiles/Gemfile-rails-7-0 | 12 ++ test/action_controller/respond_with_test.rb | 2 +- test/test_helper.rb | 2 +- 7 files changed, 112 insertions(+), 58 deletions(-) create mode 100644 gemfiles/Gemfile-rails-7-0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9da04c..7554bf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ jobs: gemfile: - Gemfile - gemfiles/Gemfile-rails-main + - gemfiles/Gemfile-rails-7-0 - gemfiles/Gemfile-rails-6-1 - gemfiles/Gemfile-rails-6-0 - gemfiles/Gemfile-rails-5-2 @@ -27,6 +28,10 @@ jobs: ruby: '2.6' - gemfile: gemfiles/Gemfile-rails-main ruby: '2.5' + - gemfile: gemfiles/Gemfile-rails-7-0 + ruby: '2.6' + - gemfile: gemfiles/Gemfile-rails-7-0 + ruby: '2.5' - gemfile: gemfiles/Gemfile-rails-6-0 ruby: '3.2' - gemfile: gemfiles/Gemfile-rails-6-0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f9c4e2..a3c252b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Unreleased +* Add support for Rails 7.1. (no changes required.) ## 3.1.0 diff --git a/Gemfile b/Gemfile index efd3734..a752fca 100644 --- a/Gemfile +++ b/Gemfile @@ -4,8 +4,8 @@ source "https://rubygems.org" gemspec -gem "activemodel", "~> 7.0.0" -gem "railties", "~> 7.0.0" +gem "activemodel", "~> 7.1.0" +gem "railties", "~> 7.1.0" gem "mocha" gem "rails-controller-testing" gem "rubocop" diff --git a/Gemfile.lock b/Gemfile.lock index de17fa7..dc8f9a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,103 +8,139 @@ PATH GEM remote: https://rubygems.org/ specs: - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) + actionpack (7.1.0) + actionview (= 7.1.0) + activesupport (= 7.1.0) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (7.0.4) - activesupport (= 7.0.4) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actionview (7.1.0) + activesupport (= 7.1.0) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activemodel (7.0.4) - activesupport (= 7.0.4) - activesupport (7.0.4) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activemodel (7.1.0) + activesupport (= 7.1.0) + activesupport (7.1.0) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) ast (2.4.2) + base64 (0.1.1) + bigdecimal (3.1.4) builder (3.2.4) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) crass (1.0.6) + drb (2.1.1) + ruby2_keywords erubi (1.12.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) + io-console (0.6.0) + irb (1.8.1) + rdoc + reline (>= 0.3.8) json (2.6.3) - loofah (2.19.1) + language_server-protocol (3.17.0.3) + loofah (2.21.4) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - method_source (1.0.0) - mini_portile2 (2.8.1) - minitest (5.17.0) - mocha (2.0.2) + nokogiri (>= 1.12.0) + mini_portile2 (2.8.4) + minitest (5.20.0) + mocha (2.1.0) ruby2_keywords (>= 0.0.5) - nokogiri (1.14.0) - mini_portile2 (~> 2.8.0) + mutex_m (0.1.2) + nokogiri (1.15.4) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.4) ast (~> 2.4.1) - racc (1.6.2) - rack (2.2.6) - rack-test (2.0.2) + racc + psych (5.1.0) + stringio + racc (1.7.1) + rack (3.0.8) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - method_source + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.6.1) - rexml (3.2.5) - rubocop (1.43.0) + rdoc (6.5.0) + psych (>= 4.0.0) + regexp_parser (2.8.2) + reline (0.3.9) + io-console (~> 0.5) + rexml (3.2.6) + rubocop (1.56.4) + base64 (~> 0.1.1) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-performance (1.15.2) + rubocop-ast (1.29.0) + parser (>= 3.2.1.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - thor (1.2.1) - tzinfo (2.0.5) + stringio (3.0.8) + thor (1.2.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - zeitwerk (2.6.6) + unicode-display_width (2.5.0) + webrick (1.8.1) + zeitwerk (2.6.12) PLATFORMS ruby DEPENDENCIES - activemodel (~> 7.0.0) + activemodel (~> 7.1.0) mocha rails-controller-testing - railties (~> 7.0.0) + railties (~> 7.1.0) responders! rubocop rubocop-performance diff --git a/gemfiles/Gemfile-rails-7-0 b/gemfiles/Gemfile-rails-7-0 new file mode 100644 index 0000000..7e3cd71 --- /dev/null +++ b/gemfiles/Gemfile-rails-7-0 @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec path: ".." + +gem "activemodel", "~> 7.0.0" +gem "railties", "~> 7.0.0" +gem "mocha" +gem "rails-controller-testing" +gem "rubocop" +gem "rubocop-performance" diff --git a/test/action_controller/respond_with_test.rb b/test/action_controller/respond_with_test.rb index 3fb81ca..2daf625 100644 --- a/test/action_controller/respond_with_test.rb +++ b/test/action_controller/respond_with_test.rb @@ -763,7 +763,7 @@ def with_test_route_set resources :quiz_stores do resources :customers end - ActiveSupport::Deprecation.silence do + (ActionDispatch.try(:deprecator) || ActiveSupport::Deprecation).silence do get ":controller/:action" end end diff --git a/test/test_helper.rb b/test/test_helper.rb index d33b88c..e5eb924 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -22,7 +22,7 @@ Responders::Routes = ActionDispatch::Routing::RouteSet.new Responders::Routes.draw do resources :news - ActiveSupport::Deprecation.silence do + (ActionDispatch.try(:deprecator) || ActiveSupport::Deprecation).silence do get "/admin/:action", controller: "admin/addresses" get "/:controller(/:action(/:id))" end