From db5088146ca5ee6bc1143c7d75bce2c40ce9b408 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 26 Apr 2024 17:10:53 +0200 Subject: [PATCH] [TASK] Drop support for Ruby 3.0 (#184) Ruby 3.0 has been EOL'ed: https://www.ruby-lang.org/en/news/2024/04/23/ruby-3-0-7-released/ Also make use of some Ruby 3.1 features. Fixes #181 --- .github/workflows/ci.yml | 3 --- .rubocop.yml | 2 +- CHANGELOG.md | 1 + lib/page_title_helper.rb | 6 +++--- page_title_helper.gemspec | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92add8e..4ac650c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,15 +64,12 @@ jobs: fail-fast: false matrix: include: - - { 'rails': '6.1', 'ruby': '3.0.7' } - { 'rails': '6.1', 'ruby': '3.1.5' } - { 'rails': '6.1', 'ruby': '3.2.4' } - { 'rails': '6.1', 'ruby': '3.3.1' } - - { 'rails': '7.0', 'ruby': '3.0.7' } - { 'rails': '7.0', 'ruby': '3.1.5' } - { 'rails': '7.0', 'ruby': '3.2.4' } - { 'rails': '7.0', 'ruby': '3.3.1' } - - { 'rails': '7.1', 'ruby': '3.0.7' } - { 'rails': '7.1', 'ruby': '3.1.5' } - { 'rails': '7.1', 'ruby': '3.2.4' } - { 'rails': '7.1', 'ruby': '3.3.1' } diff --git a/.rubocop.yml b/.rubocop.yml index 6777b7c..9777962 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: - rubocop-rails AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 TargetRailsVersion: 6.1 NewCops: enable diff --git a/CHANGELOG.md b/CHANGELOG.md index d14a65b..97d3f10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ about why a change log is important. ### Deprecated ### Removed +- Drop support for Ruby 3.0 (#184) ### Fixed diff --git a/lib/page_title_helper.rb b/lib/page_title_helper.rb index 07dca0f..55497ca 100644 --- a/lib/page_title_helper.rb +++ b/lib/page_title_helper.rb @@ -34,8 +34,8 @@ def title(env) end # Add new, custom, interpolation. - def self.interpolates(key, &block) - Interpolations.send(:define_method, key, &block) + def self.interpolates(key, &) + Interpolations.send(:define_method, key, &) end # Default options, which are globally referenced and can @@ -75,7 +75,7 @@ def page_title(options = nil) format = PageTitleHelper.formats[format] if PageTitleHelper.formats.include?(format) # construct basic env to pass around - env = { title: real_title, app: options[:app], options: options, view: self } + env = { title: real_title, app: options[:app], options:, view: self } # interpolate format Interpolations.interpolate(format, env) diff --git a/page_title_helper.gemspec b/page_title_helper.gemspec index ff3375e..7cafed9 100644 --- a/page_title_helper.gemspec +++ b/page_title_helper.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |s| s.summary = 'Simple, internationalized and DRY page titles and headings for Rails.' s.description = 'Simple, internationalized and DRY page titles and headings for Rails.' - s.required_ruby_version = '>= 3.0.0' + s.required_ruby_version = '>= 3.1.0' s.authors = ['Lukas Westermann'] s.email = ['lukas.westermann@gmail.com']