From bd7e1be0a61e4889a9beb54040029fbf784fcafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Inge=20J=C3=B8rgensen?= Date: Wed, 16 Oct 2024 09:41:22 +0200 Subject: [PATCH] Require Ruby 3.2 --- .github/workflows/build.yml | 2 +- .rubocop.yml | 2 +- app/models/page_builder.rb | 4 ++-- lib/pages_core.rb | 4 ++-- lib/pages_core/templates/configuration_proxy.rb | 6 +++--- pages_core.gemspec | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18be17e4..b133692b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: - ruby: ["3.1", "3.2", "3.3"] + ruby: ["3.2", "3.3"] services: postgres: image: postgres:latest diff --git a/.rubocop.yml b/.rubocop.yml index 4d836f61..5692fef2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,7 +15,7 @@ inherit_mode: AllCops: NewCops: enable - TargetRubyVersion: 3.1 + TargetRubyVersion: 3.2 Exclude: - "spec/internal/db/schema.rb" - "node_modules/**/*" diff --git a/app/models/page_builder.rb b/app/models/page_builder.rb index d111b80b..b5eb263b 100644 --- a/app/models/page_builder.rb +++ b/app/models/page_builder.rb @@ -18,9 +18,9 @@ class PageBuilder attr_reader :user, :locale, :parent class << self - def build(user, locale: nil, parent: nil, &block) + def build(user, locale: nil, parent: nil, &) new(user, locale:, parent:) - .run(&block) + .run(&) end end diff --git a/lib/pages_core.rb b/lib/pages_core.rb index c6efdc6e..9b8c5f6f 100644 --- a/lib/pages_core.rb +++ b/lib/pages_core.rb @@ -80,10 +80,10 @@ def configure(_options = {}, &) yield configuration if block_given? end - def configuration(key = nil, *args) + def configuration(key = nil, *) @configuration ||= PagesCore::Configuration::Pages.new if key - @configuration.send(key, *args) + @configuration.send(key, *) else @configuration end diff --git a/lib/pages_core/templates/configuration_proxy.rb b/lib/pages_core/templates/configuration_proxy.rb index 84fe8d7a..bf59a111 100644 --- a/lib/pages_core/templates/configuration_proxy.rb +++ b/lib/pages_core/templates/configuration_proxy.rb @@ -8,15 +8,15 @@ def initialize(callback, parent = nil) @parent = parent end - def method_missing(method_name, *args, &block) + def method_missing(method_name, *, &block) if @parent && block @callback.call(@parent, method_name, block) elsif @parent - @callback.call(@parent, method_name, *args) + @callback.call(@parent, method_name, *) elsif block @callback.call(method_name, block) else - @callback.call(method_name, *args) + @callback.call(method_name, *) end end diff --git a/pages_core.gemspec b/pages_core.gemspec index f921ccc8..63a35e41 100644 --- a/pages_core.gemspec +++ b/pages_core.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.summary = "Pages Core" s.description = "Pages Core" - s.required_ruby_version = ">= 3.1.0" + s.required_ruby_version = ">= 3.2.0" s.files = Dir[ "{app,config,db,lib,vendor}/**/*",