From 627575cadda2d5df3fb8ef099729a3bdb2c5d2bd Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Sun, 30 Jun 2024 12:38:53 +0200 Subject: [PATCH] Drop support for Ruby < 2.7 and Rails < 6.0 --- .github/workflows/test.yml | 46 ++++----------------- CHANGELOG.md | 4 +- Gemfile.lock | 4 +- gemfiles/Gemfile-rails-5-2 | 10 ----- gemfiles/Gemfile-rails-6-0 | 10 ----- simple_form.gemspec | 6 +-- test/action_view_extensions/builder_test.rb | 12 +----- 7 files changed, 17 insertions(+), 75 deletions(-) delete mode 100644 gemfiles/Gemfile-rails-5-2 delete mode 100644 gemfiles/Gemfile-rails-6-0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 267e3cd49..66584d876 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,49 +10,17 @@ jobs: - gemfiles/Gemfile-rails-main - gemfiles/Gemfile-rails-7-0 - gemfiles/Gemfile-rails-6-1 - - gemfiles/Gemfile-rails-6-0 - - gemfiles/Gemfile-rails-5-2 ruby: - - '3.3' - - '3.2' - - '3.1' - - '3.0' - - '2.7' - - '2.6' - - '2.5' + - "3.3" + - "3.2" + - "3.1" + - "3.0" + - "2.7" exclude: - - gemfile: Gemfile - ruby: '2.6' - - gemfile: Gemfile - ruby: '2.5' - gemfile: gemfiles/Gemfile-rails-main - ruby: '3.0' + ruby: "3.0" - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-main - 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.3' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '3.2' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '3.3' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '3.2' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.7' + ruby: "2.7" runs-on: ubuntu-latest env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7d57da9..c179da0dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased - +* breaking changes + * Drop support to Ruby < 2.7 + * Drop support to Rails < 6.0 * Remove redundant `aria-required` attribute for required fields. [@aduth](https://github.com/aduth) ## 5.3.1 diff --git a/Gemfile.lock b/Gemfile.lock index e69979ce7..de9c1b3f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,8 @@ PATH remote: . specs: simple_form (5.3.1) - actionpack (>= 5.2) - activemodel (>= 5.2) + actionpack (>= 6.1) + activemodel (>= 6.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/Gemfile-rails-5-2 b/gemfiles/Gemfile-rails-5-2 deleted file mode 100644 index 0f9df0a8b..000000000 --- a/gemfiles/Gemfile-rails-5-2 +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://rubygems.org' - -gemspec path: '..' - -gem 'country_select' -gem 'railties', '~> 5.2.0' -gem 'activemodel', '~> 5.2.0' -gem 'actionpack', '~> 5.2.0' -gem 'rake' -gem 'tzinfo' diff --git a/gemfiles/Gemfile-rails-6-0 b/gemfiles/Gemfile-rails-6-0 deleted file mode 100644 index ce480a9b8..000000000 --- a/gemfiles/Gemfile-rails-6-0 +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://rubygems.org' - -gemspec path: '..' - -gem 'country_select' -gem 'railties', '~> 6.0.0' -gem 'activemodel', '~> 6.0.0' -gem 'actionpack', '~> 6.0.0' -gem 'rake' -gem 'tzinfo' diff --git a/simple_form.gemspec b/simple_form.gemspec index 6364bd923..aaaaf59d9 100644 --- a/simple_form.gemspec +++ b/simple_form.gemspec @@ -24,8 +24,8 @@ Gem::Specification.new do |s| s.files = Dir["CHANGELOG.md", "MIT-LICENSE", "README.md", "lib/**/*"] s.require_paths = ["lib"] - s.required_ruby_version = '>= 2.5.0' + s.required_ruby_version = '>= 2.7.0' - s.add_dependency('activemodel', '>= 5.2') - s.add_dependency('actionpack', '>= 5.2') + s.add_dependency('activemodel', '>= 6.1') + s.add_dependency('actionpack', '>= 6.1') end diff --git a/test/action_view_extensions/builder_test.rb b/test/action_view_extensions/builder_test.rb index 974013c5e..8647ecc3a 100644 --- a/test/action_view_extensions/builder_test.rb +++ b/test/action_view_extensions/builder_test.rb @@ -46,16 +46,8 @@ def with_collection_check_boxes(object, attribute, collection, value_method, tex test "collection radio sanitizes collection values for labels correctly" do with_collection_radio_buttons @user, :name, ['$0.99', '$1.99'], :to_s, :to_s - # Rails 6 changed the way it sanitizes the values - # https://github.com/rails/rails/blob/6-0-stable/actionview/lib/action_view/helpers/tags/base.rb#L141 - # https://github.com/rails/rails/blob/5-2-stable/actionview/lib/action_view/helpers/tags/base.rb#L141 - if ActionView::VERSION::MAJOR == 5 - assert_select 'label.collection_radio_buttons[for=user_name_099]', '$0.99' - assert_select 'label.collection_radio_buttons[for=user_name_199]', '$1.99' - else - assert_select 'label.collection_radio_buttons[for=user_name_0_99]', '$0.99' - assert_select 'label.collection_radio_buttons[for=user_name_1_99]', '$1.99' - end + assert_select 'label.collection_radio_buttons[for=user_name_0_99]', '$0.99' + assert_select 'label.collection_radio_buttons[for=user_name_1_99]', '$1.99' end test "collection radio checks the correct value to local variables" do