From bd5d6142bbdc7ae48cbee14278ff5cc06a1f7f4a Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Tue, 18 Feb 2025 12:42:47 +0100 Subject: [PATCH 1/9] Support for Ruby 3.4 --- .github/workflows/main.yml | 2 +- .ruby-version | 2 +- ja2r.gemspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 937f254..d3d4cfa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: activesupport: ['6.1', '7.0', '7.1', '7.2'] - ruby: ['3.1', '3.2', '3.3'] + ruby: ['3.1', '3.2', '3.3', '3.4'] steps: - uses: actions/checkout@v2 - name: Set up Ruby diff --git a/.ruby-version b/.ruby-version index 619b537..4d9d11c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.3 +3.4.2 diff --git a/ja2r.gemspec b/ja2r.gemspec index 049297c..08c7a06 100644 --- a/ja2r.gemspec +++ b/ja2r.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/mkon/ja2r' s.summary = 'Simple JSON-API to ruby object conversion' s.license = 'MIT' - s.required_ruby_version = '>= 3.1', '< 3.4' + s.required_ruby_version = '>= 3.1', '< 3.5' s.files = Dir['{app,config,db,lib}/**/*', 'LICENSE', 'README.md'] From a574accfa3a9011d60ba5f4df25f21fb8e32c4bd Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Tue, 18 Feb 2025 12:49:25 +0100 Subject: [PATCH 2/9] manually require logger --- ja2r.gemspec | 1 + lib/ja2r.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ja2r.gemspec b/ja2r.gemspec index 08c7a06..f979948 100644 --- a/ja2r.gemspec +++ b/ja2r.gemspec @@ -14,6 +14,7 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,db,lib}/**/*', 'LICENSE', 'README.md'] s.add_dependency 'activesupport', '>= 6.1', '< 8.0' + s.add_dependency 'logger', '~> 1.6' s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/ja2r.rb b/lib/ja2r.rb index f13cab9..f74cc28 100644 --- a/lib/ja2r.rb +++ b/lib/ja2r.rb @@ -1,3 +1,5 @@ +require 'logger' + require 'active_support' require 'active_support/core_ext/array' require 'active_support/core_ext/hash' From efdb6e2e405d88c6e09e3f4dd94d28b3835c869c Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Tue, 18 Feb 2025 12:55:09 +0100 Subject: [PATCH 3/9] add base64 and bigdecimal to gemfile (old as & new ruby) --- Gemfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Gemfile b/Gemfile index 9789e85..36870a6 100644 --- a/Gemfile +++ b/Gemfile @@ -20,4 +20,8 @@ end if (version = ENV['ACTIVESUPPORT']) gem 'activesupport', "~> #{version}.0" + + # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) + gem 'base64' + gem 'bigdecimal' end From 921a19cc57a6175b72caed43f724aa6cf6ca4999 Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Tue, 18 Feb 2025 12:59:44 +0100 Subject: [PATCH 4/9] always --- Gemfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 36870a6..d924aaa 100644 --- a/Gemfile +++ b/Gemfile @@ -18,10 +18,11 @@ group :development, :test do gem 'simplecov', '~> 0.16' end +# Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) +gem 'base64' +gem 'bigdecimal' + if (version = ENV['ACTIVESUPPORT']) gem 'activesupport', "~> #{version}.0" - - # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) - gem 'base64' - gem 'bigdecimal' end + From 1c3c873d5308b2c55cea542a037b0b84cd47e9ff Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Tue, 18 Feb 2025 13:00:48 +0100 Subject: [PATCH 5/9] rubocop -A --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index d924aaa..4ae7415 100644 --- a/Gemfile +++ b/Gemfile @@ -25,4 +25,3 @@ gem 'bigdecimal' if (version = ENV['ACTIVESUPPORT']) gem 'activesupport', "~> #{version}.0" end - From cc0014f26cdd4cd4d0e7e700be57a9bee1ddd247 Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Wed, 19 Feb 2025 14:04:55 +0100 Subject: [PATCH 6/9] remove explicit logger dependency --- Gemfile | 1 + ja2r.gemspec | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 4ae7415..2c605d2 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ end # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) gem 'base64' gem 'bigdecimal' +gem 'logger' if (version = ENV['ACTIVESUPPORT']) gem 'activesupport', "~> #{version}.0" diff --git a/ja2r.gemspec b/ja2r.gemspec index f979948..08c7a06 100644 --- a/ja2r.gemspec +++ b/ja2r.gemspec @@ -14,7 +14,6 @@ Gem::Specification.new do |s| s.files = Dir['{app,config,db,lib}/**/*', 'LICENSE', 'README.md'] s.add_dependency 'activesupport', '>= 6.1', '< 8.0' - s.add_dependency 'logger', '~> 1.6' s.metadata['rubygems_mfa_required'] = 'true' end From 864947abc45e2be7a06ba8b8a1225ee22c4c68e6 Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Wed, 19 Feb 2025 14:16:23 +0100 Subject: [PATCH 7/9] also remove from gemfile --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2c605d2..4ae7415 100644 --- a/Gemfile +++ b/Gemfile @@ -21,7 +21,6 @@ end # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) gem 'base64' gem 'bigdecimal' -gem 'logger' if (version = ENV['ACTIVESUPPORT']) gem 'activesupport', "~> #{version}.0" From a03fa292a621828d8888eba9901e47c7102664d5 Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Wed, 19 Feb 2025 14:22:28 +0100 Subject: [PATCH 8/9] nit: add comment --- lib/ja2r.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ja2r.rb b/lib/ja2r.rb index f74cc28..947f92f 100644 --- a/lib/ja2r.rb +++ b/lib/ja2r.rb @@ -1,4 +1,4 @@ -require 'logger' +require 'logger' # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) require 'active_support' require 'active_support/core_ext/array' From 8904bc9d488b39748d609b2c79dc5231926bbb61 Mon Sep 17 00:00:00 2001 From: Klaus Meyer Date: Wed, 19 Feb 2025 15:26:17 +0100 Subject: [PATCH 9/9] move to gemfile --- Gemfile | 3 +++ lib/ja2r.rb | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 4ae7415..5f9e315 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,8 @@ source 'https://rubygems.org' +# Silence warning in ruby 3.4 (will no longer be part of the default gems starting from Ruby 3.5) +gem 'logger' + # Declare your gem's dependencies in keys-oauth.gemspec. # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group. diff --git a/lib/ja2r.rb b/lib/ja2r.rb index 947f92f..f13cab9 100644 --- a/lib/ja2r.rb +++ b/lib/ja2r.rb @@ -1,5 +1,3 @@ -require 'logger' # Required for combination of old activesupport (< 7.1) and new ruby (> 3.3) - require 'active_support' require 'active_support/core_ext/array' require 'active_support/core_ext/hash'