From e845a5df902b8b0b63d47b49a55500abb178b15b Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sun, 22 Dec 2024 15:39:15 +0100 Subject: [PATCH] Drop EOL Ruby support --- .github/workflows/ruby.yml | 10 +--------- .rubocop.yml | 2 +- CHANGELOG.md | 4 ++++ Gemfile | 18 ++++++++++-------- lib/route_translator.rb | 2 +- lib/route_translator/version.rb | 2 +- route_translator.gemspec | 2 +- test/support/routes_helper.rb | 4 ++-- test/test_helper.rb | 2 +- 9 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index b1316ed9..ee709605 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3'] + ruby-version: ['3.1', '3.2', '3.3'] gemfile: [rails_6.1, rails_7.0, rails_7.1, rails_7.2, rails_8.0] channel: ['stable'] @@ -40,14 +40,6 @@ jobs: channel: 'experimental' exclude: - - ruby-version: '2.7' - gemfile: rails_7.2 - - ruby-version: '2.7' - gemfile: rails_8.0 - - ruby-version: '3.0' - gemfile: rails_7.2 - - ruby-version: '3.0' - gemfile: rails_8.0 - ruby-version: '3.1' gemfile: rails_8.0 - ruby-version: '3.2' diff --git a/.rubocop.yml b/.rubocop.yml index dfba9149..3c3f5714 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,7 @@ require: AllCops: TargetRailsVersion: 6.1 - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 NewCops: enable DisplayStyleGuide: true ExtraDetails: true diff --git a/CHANGELOG.md b/CHANGELOG.md index dafd5204..341610de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 15.0.0 / unreleased + +* [FEATURE] Drop Ruby < 3.1 support + ## 14.2.0 / 2024-11-08 * [FEATURE] Rails 8.0 compatibility diff --git a/Gemfile b/Gemfile index a2190d37..9c03e2c6 100644 --- a/Gemfile +++ b/Gemfile @@ -9,11 +9,13 @@ gem 'byebug' gem 'minitest' gem 'rails' gem 'rake' -gem 'rubocop' -gem 'rubocop-minitest' -gem 'rubocop-packaging' -gem 'rubocop-performance' -gem 'rubocop-rails' -gem 'rubocop-rake' -gem 'simplecov' -gem 'simplecov-lcov' + +gem 'rubocop', require: false +gem 'rubocop-minitest', require: false +gem 'rubocop-packaging', require: false +gem 'rubocop-performance', require: false +gem 'rubocop-rails', require: false +gem 'rubocop-rake', require: false + +gem 'simplecov', require: false +gem 'simplecov-lcov', require: false diff --git a/lib/route_translator.rb b/lib/route_translator.rb index 8fd97189..f26223f5 100644 --- a/lib/route_translator.rb +++ b/lib/route_translator.rb @@ -10,7 +10,7 @@ module RouteTranslator extend RouteTranslator::Host - TRANSLATABLE_SEGMENT = /^([-_a-zA-Z0-9]+)(\()?/.freeze + TRANSLATABLE_SEGMENT = /^([-_a-zA-Z0-9]+)(\()?/ DEFAULT_CONFIGURATION = { available_locales: [], diff --git a/lib/route_translator/version.rb b/lib/route_translator/version.rb index 5f31f391..9506f451 100644 --- a/lib/route_translator/version.rb +++ b/lib/route_translator/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module RouteTranslator - VERSION = '14.2.0' + VERSION = '15.0.0' end diff --git a/route_translator.gemspec b/route_translator.gemspec index ad9a0494..5c6ee401 100644 --- a/route_translator.gemspec +++ b/route_translator.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.files = Dir.glob('{CHANGELOG.md,LICENSE,README.md,lib/**/*.rb}', File::FNM_DOTMATCH) spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.7' + spec.required_ruby_version = '>= 3.1' spec.add_dependency 'actionpack', '>= 6.1' spec.add_dependency 'activesupport', '>= 6.1' diff --git a/test/support/routes_helper.rb b/test/support/routes_helper.rb index 04f72d57..53f927ee 100644 --- a/test/support/routes_helper.rb +++ b/test/support/routes_helper.rb @@ -2,8 +2,8 @@ module RouteTranslator module RoutesHelper - def draw_routes(&block) - @routes.draw(&block) + def draw_routes(&) + @routes.draw(&) if @routes.respond_to?(:install_helpers) @routes.install_helpers else diff --git a/test/test_helper.rb b/test/test_helper.rb index ddf0e86f..84047abc 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -47,6 +47,6 @@ def initialize(env = {}) end end -Dir[File.expand_path('support/*.rb', __dir__)].sort.each do |helper| +Dir[File.expand_path('support/*.rb', __dir__)].each do |helper| require helper end