From edf4f5d9d0e1ee5c5d5132e641e9dddbdf717e2f Mon Sep 17 00:00:00 2001 From: Pedro Paiva Date: Thu, 4 Mar 2021 19:43:38 -0300 Subject: [PATCH] Remove Rails 4.2 support (#1422) --- .github/workflows/ci.yml | 4 - Appraisals | 23 --- README.md | 2 +- gemfiles/rails_4_2.gemfile | 37 ----- gemfiles/rails_4_2.gemfile.lock | 261 -------------------------------- shoulda-matchers.gemspec | 2 +- spec/support/unit/capture.rb | 4 +- 7 files changed, 4 insertions(+), 329 deletions(-) delete mode 100644 gemfiles/rails_4_2.gemfile delete mode 100644 gemfiles/rails_4_2.gemfile.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dba7f501..f572b4e31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,13 +35,9 @@ jobs: - rails_5_2 - rails_5_1 - rails_5_0 - - rails_4_2 adapter: - sqlite3 - postgresql - exclude: - - { ruby: 2.7.2, appraisal: rails_4_2 } - - { ruby: 2.6.6, appraisal: rails_4_2 } env: DATABASE_ADAPTER: ${{ matrix.adapter }} BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile diff --git a/Appraisals b/Appraisals index f2a42ed69..53a4418af 100644 --- a/Appraisals +++ b/Appraisals @@ -23,29 +23,6 @@ shared_dependencies = proc do instance_eval(&shared_test_dependencies) end -appraise 'rails_4_2' do - instance_eval(&shared_dependencies) - - gem 'rails', '4.2.11.1' - gem 'sass-rails', '~> 5.0' - gem 'uglifier', '>= 1.3.0' - gem 'coffee-rails', '~> 4.1.0' - gem 'jquery-rails' - gem 'turbolinks' - gem 'jbuilder', '~> 2.0' - gem 'sdoc', '~> 0.4.0', group: :doc - gem 'bcrypt', '~> 3.1.7' - - # Other dependencies - gem 'activeresource', '4.0.0' - gem 'json', '~> 1.4' - gem 'protected_attributes', '~> 1.0.6' - - # Database adapters - gem 'pg', '~> 0.18' - gem 'sqlite3', '~> 1.3.6' -end - appraise 'rails_5_0' do instance_eval(&shared_dependencies) instance_eval(&controller_test_dependency) diff --git a/README.md b/README.md index f90b8df77..ab85ceb67 100644 --- a/README.md +++ b/README.md @@ -469,7 +469,7 @@ machine, understanding the codebase, and creating a good pull request. ## Compatibility Shoulda Matchers is tested and supported against Ruby 2.5+, Rails -4.2+, RSpec 3.x, and Minitest 5.x. +5.0+, RSpec 3.x, and Minitest 5.x. - For Ruby < 2.4 and Rails < 4.1 compatibility, please use [v3.1.3][v3.1.3]. - For Ruby < 3.0 and Rails < 6.1 compatibility, please use [v4.5.1][v4.5.1]. diff --git a/gemfiles/rails_4_2.gemfile b/gemfiles/rails_4_2.gemfile deleted file mode 100644 index bd21400bc..000000000 --- a/gemfiles/rails_4_2.gemfile +++ /dev/null @@ -1,37 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal", "2.2.0" -gem "bundler", "~> 1.1" -gem "pry" -gem "pry-byebug" -gem "rake", "13.0.1" -gem "rspec", "~> 3.9" -gem "rubocop", require: false -gem "rubocop-packaging", require: false -gem "rubocop-rails", require: false -gem "warnings_logger" -gem "zeus", require: false -gem "fssm" -gem "redcarpet" -gem "rouge" -gem "yard" -gem "spring" -gem "spring-commands-rspec" -gem "rspec-rails", "~> 4.0" -gem "shoulda-context", "~> 1.2.0" -gem "rails", "4.2.11.1" -gem "sass-rails", "~> 5.0" -gem "uglifier", ">= 1.3.0" -gem "coffee-rails", "~> 4.1.0" -gem "jquery-rails" -gem "turbolinks" -gem "jbuilder", "~> 2.0" -gem "sdoc", "~> 0.4.0", group: :doc -gem "bcrypt", "~> 3.1.7" -gem "activeresource", "4.0.0" -gem "json", "~> 1.4" -gem "protected_attributes", "~> 1.0.6" -gem "pg", "~> 0.18" -gem "sqlite3", "~> 1.3.6" diff --git a/gemfiles/rails_4_2.gemfile.lock b/gemfiles/rails_4_2.gemfile.lock deleted file mode 100644 index faf859072..000000000 --- a/gemfiles/rails_4_2.gemfile.lock +++ /dev/null @@ -1,261 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.2.11.1) - actionpack (= 4.2.11.1) - actionview (= 4.2.11.1) - activejob (= 4.2.11.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.11.1) - actionview (= 4.2.11.1) - activesupport (= 4.2.11.1) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.11.1) - activesupport (= 4.2.11.1) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.11.1) - activesupport (= 4.2.11.1) - globalid (>= 0.3.0) - activemodel (4.2.11.1) - activesupport (= 4.2.11.1) - builder (~> 3.1) - activerecord (4.2.11.1) - activemodel (= 4.2.11.1) - activesupport (= 4.2.11.1) - arel (~> 6.0) - activeresource (4.0.0) - activemodel (~> 4.0) - activesupport (~> 4.0) - rails-observers (~> 0.1.1) - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - appraisal (2.2.0) - bundler - rake - thor (>= 0.14.0) - arel (6.0.4) - ast (2.4.2) - bcrypt (3.1.16) - builder (3.2.4) - byebug (11.1.3) - coderay (1.1.3) - coffee-rails (4.1.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.1.x) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.12.2) - concurrent-ruby (1.1.8) - crass (1.0.6) - diff-lcs (1.4.4) - erubis (2.7.0) - execjs (2.7.0) - ffi (1.14.2) - fssm (0.2.10) - globalid (0.4.2) - activesupport (>= 4.2.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jbuilder (2.9.1) - activesupport (>= 4.2.0) - jquery-rails (4.4.0) - rails-dom-testing (>= 1, < 3) - railties (>= 4.2.0) - thor (>= 0.14, < 2.0) - json (1.8.6) - loofah (2.9.0) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - method_source (1.0.0) - mini_mime (1.0.2) - mini_portile2 (2.5.0) - minitest (5.14.4) - nokogiri (1.11.1) - mini_portile2 (~> 2.5.0) - racc (~> 1.4) - parallel (1.20.1) - parser (3.0.0.0) - ast (~> 2.4.1) - pg (0.21.0) - protected_attributes (1.0.9) - activemodel (>= 4.0.1, < 5.0) - pry (0.13.1) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.9.0) - byebug (~> 11.0) - pry (~> 0.13.0) - racc (1.5.2) - rack (1.6.13) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.2.11.1) - actionmailer (= 4.2.11.1) - actionpack (= 4.2.11.1) - actionview (= 4.2.11.1) - activejob (= 4.2.11.1) - activemodel (= 4.2.11.1) - activerecord (= 4.2.11.1) - activesupport (= 4.2.11.1) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.11.1) - sprockets-rails - rails-deprecated_sanitizer (1.0.4) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) - rails-observers (0.1.5) - activemodel (>= 4.0) - railties (4.2.11.1) - actionpack (= 4.2.11.1) - activesupport (= 4.2.11.1) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rainbow (3.0.0) - rake (13.0.1) - rb-fsevent (0.10.4) - rb-inotify (0.10.1) - ffi (~> 1.0) - rdoc (4.3.0) - redcarpet (3.5.1) - regexp_parser (2.1.1) - rexml (3.2.4) - rouge (3.26.0) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (4.0.2) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.10.2) - rubocop (1.10.0) - parallel (~> 1.10) - parser (>= 3.0.0.0) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.2.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.4.1) - parser (>= 2.7.1.5) - rubocop-packaging (0.5.1) - rubocop (>= 0.89, < 2.0) - rubocop-rails (2.9.1) - activesupport (>= 4.2.0) - rack (>= 1.1) - rubocop (>= 0.90.0, < 2.0) - ruby-progressbar (1.11.0) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - sdoc (0.4.2) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) - shoulda-context (1.2.2) - spring (2.1.1) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.13) - thor (1.1.0) - thread_safe (0.3.6) - tilt (2.0.10) - turbolinks (5.2.1) - turbolinks-source (~> 5.2) - turbolinks-source (5.2.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) - unicode-display_width (2.0.0) - warnings_logger (0.1.1) - yard (0.9.26) - zeus (0.15.14) - method_source (>= 0.6.7) - -PLATFORMS - ruby - -DEPENDENCIES - activeresource (= 4.0.0) - appraisal (= 2.2.0) - bcrypt (~> 3.1.7) - bundler (~> 1.1) - coffee-rails (~> 4.1.0) - fssm - jbuilder (~> 2.0) - jquery-rails - json (~> 1.4) - pg (~> 0.18) - protected_attributes (~> 1.0.6) - pry - pry-byebug - rails (= 4.2.11.1) - rake (= 13.0.1) - redcarpet - rouge - rspec (~> 3.9) - rspec-rails (~> 4.0) - rubocop - rubocop-packaging - rubocop-rails - sass-rails (~> 5.0) - sdoc (~> 0.4.0) - shoulda-context (~> 1.2.0) - spring - spring-commands-rspec - sqlite3 (~> 1.3.6) - turbolinks - uglifier (>= 1.3.0) - warnings_logger - yard - zeus - -BUNDLED WITH - 1.17.3 diff --git a/shoulda-matchers.gemspec b/shoulda-matchers.gemspec index 7c0b5393f..81aa9d881 100644 --- a/shoulda-matchers.gemspec +++ b/shoulda-matchers.gemspec @@ -37,5 +37,5 @@ Gem::Specification.new do |s| s.require_paths = ['lib'] s.required_ruby_version = '>= 2.5.0' - s.add_dependency('activesupport', '>= 4.2.0') + s.add_dependency('activesupport', '>= 5.0.0') end diff --git a/spec/support/unit/capture.rb b/spec/support/unit/capture.rb index ecdbde106..8cab45439 100644 --- a/spec/support/unit/capture.rb +++ b/spec/support/unit/capture.rb @@ -1,6 +1,6 @@ module Kernel - # #capture, #silence_stream, and #silence_stderr are deprecated after Rails - # 4.2 and will be removed in 5.0, so just override them completely here + # #capture, #silence_stream, and #silence_stderr were removed in rails 5.0, + # but we keep it them here if method_defined?(:capture) undef_method :capture