From 5c75ce19f11001661cd2443ec241a1b0ee92b4bb Mon Sep 17 00:00:00 2001 From: Adam Leach Date: Fri, 17 Jan 2025 14:37:59 +0000 Subject: [PATCH 1/2] Update Ruby version requirements and logger method signatures --- .github/workflows/ruby.yml | 2 +- .rubocop.yml | 6 ++++-- .ruby-version | 2 +- lib/twiglet/logger.rb | 22 +++++++++++----------- test/logger_test.rb | 2 +- twiglet.gemspec | 2 +- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 9e73bf5..ffe2ecf 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: - ruby-version: [3.0, 3.1, 3.2, 3.3] + ruby-version: [3.1, 3.2, 3.3, 3.4] steps: - uses: actions/checkout@v4 diff --git a/.rubocop.yml b/.rubocop.yml index 1b42a6d..5b77cb3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,10 @@ inherit_gem: - simplycop: .simplycop.yml + simplycop: + - .simplycop.yml + - .simplycop_performance.yml AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 Metrics/BlockLength: Max: 250 diff --git a/.ruby-version b/.ruby-version index be94e6f..47b322c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +3.4.1 diff --git a/lib/twiglet/logger.rb b/lib/twiglet/logger.rb index abcfd15..4069125 100644 --- a/lib/twiglet/logger.rb +++ b/lib/twiglet/logger.rb @@ -44,25 +44,25 @@ def configure_validation_error_response(&block) @validator.custom_error_handler = block end - def debug(message_or_error = nil, &block) + def debug(message_or_error = nil, &) message = message_or_error.is_a?(Exception) ? error_message(message_or_error) : message_or_error - super(message, &block) + super(message, &) end - def info(message_or_error = nil, &block) + def info(message_or_error = nil, &) message = message_or_error.is_a?(Exception) ? error_message(message_or_error) : message_or_error - super(message, &block) + super(message, &) end - def warn(message_or_error = nil, &block) + def warn(message_or_error = nil, &) message = message_or_error.is_a?(Exception) ? error_message(message_or_error) : message_or_error - super(message, &block) + super(message, &) end - def error(message_or_error = nil, error = nil, &block) + def error(message_or_error = nil, error = nil, &) message = if error error_message(error, message_or_error) elsif message_or_error.is_a?(Exception) @@ -71,20 +71,20 @@ def error(message_or_error = nil, error = nil, &block) message_or_error end - super(message, &block) + super(message, &) end def with(default_properties) self.class.new( @service_name, - **@args.merge(default_properties: default_properties) + **@args, default_properties: default_properties ) end def validation_schema(validation_schema) self.class.new( @service_name, - **@args.merge(validation_schema: validation_schema) + **@args, validation_schema: validation_schema ) end @@ -94,7 +94,7 @@ def context_provider(&blk) self.class.new( @service_name, - **@args.merge(context_providers: new_context_providers) + **@args, context_providers: new_context_providers ) end diff --git a/test/logger_test.rb b/test/logger_test.rb index 649e496..05c2fc5 100644 --- a/test/logger_test.rb +++ b/test/logger_test.rb @@ -50,7 +50,7 @@ :level=, :sev_threshold= ].each do |call| - assert @logger.respond_to?(call), "Logger does not respond to #{call}" + assert_respond_to @logger, call, "Logger does not respond to #{call}" end end diff --git a/twiglet.gemspec b/twiglet.gemspec index 2ea59df..69e0b16 100644 --- a/twiglet.gemspec +++ b/twiglet.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |gem| gem.files = `git ls-files`.split("\n") gem.require_paths = ['lib'] - gem.required_ruby_version = '>= 3.0' + gem.required_ruby_version = ['>= 3.1 ', '< 3.5'] gem.license = 'Copyright SimplyBusiness' From 17dcde349a5336e5cc3fe419faff3cc4829a6d2a Mon Sep 17 00:00:00 2001 From: "dobby-app[bot]" <78910979+dobby-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:48:54 +0000 Subject: [PATCH 2/2] Bump minor version --- lib/twiglet/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/twiglet/version.rb b/lib/twiglet/version.rb index c35ecca..f6d209d 100644 --- a/lib/twiglet/version.rb +++ b/lib/twiglet/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Twiglet - VERSION = '3.13.5' + VERSION = '3.14.0' end