From 117144b762da614c7d7ad87b8bc0076f0c9f1975 Mon Sep 17 00:00:00 2001 From: Jose Colella Date: Thu, 5 Mar 2026 07:53:33 -0800 Subject: [PATCH 1/4] feat!: add Ruby 4.0 support, require minimum Ruby 3.4 BREAKING CHANGE: Minimum required Ruby version is now 3.4. Ruby 3.1, 3.2, and 3.3 are no longer supported. - Update gemspec required_ruby_version to >= 3.4 - Update CI matrix to test Ruby 4.0 and 3.4 - Update .ruby-version and .tool-versions to 4.0.1 - Update README supported versions table - Regenerate Gemfile.lock for Ruby 4.0 compatibility Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Jose Colella --- .github/workflows/main.yml | 5 +- .ruby-version | 2 +- .tool-versions | 2 +- Gemfile.lock | 95 ++++++++++++++++++++++---------------- README.md | 5 +- openfeature-sdk.gemspec | 2 +- 6 files changed, 62 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe1de0aa..388c6620 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,9 +17,8 @@ jobs: # - macos-latest # - windows-latest ruby: - - "3.3" - - "3.2" - - "3.1" + - "4.0" + - "3.4" env: BUNDLE_GEMFILE: Gemfile diff --git a/.ruby-version b/.ruby-version index 7921bd0c..1454f6ed 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.8 +4.0.1 diff --git a/.tool-versions b/.tool-versions index 58766197..6e03b218 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 3.4.8 +ruby 4.0.1 diff --git a/Gemfile.lock b/Gemfile.lock index a5738328..c797c5b5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,36 +6,46 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) - debug (1.9.2) + ast (2.4.3) + date (3.5.1) + debug (1.11.1) irb (~> 1.10) reline (>= 0.3.8) - diff-lcs (1.5.1) - docile (1.4.0) - io-console (0.7.2) - irb (1.12.0) - rdoc + diff-lcs (1.6.2) + docile (1.4.1) + erb (6.0.2) + io-console (0.8.2) + irb (1.17.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.1) - language_server-protocol (3.17.0.3) + json (2.18.1) + language_server-protocol (3.17.0.5) lint_roller (1.1.0) - markly (0.10.0) - parallel (1.24.0) - parser (3.3.0.5) + markly (0.15.2) + parallel (1.27.0) + parser (3.3.10.2) ast (~> 2.4.1) racc - psych (5.1.2) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + psych (5.3.1) + date stringio - racc (1.7.3) + racc (1.8.1) rainbow (3.1.1) - rake (13.1.0) - rdoc (6.6.3.1) + rake (13.3.1) + rdoc (7.2.0) + erb psych (>= 4.0.0) - regexp_parser (2.9.0) - reline (0.5.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) io-console (~> 0.5) - rexml (3.3.6) - strscan + rexml (3.4.4) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -49,22 +59,24 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.2) - rubocop (1.62.1) + rubocop (1.84.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-performance (1.20.2) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (1.13.0) simplecov (0.22.0) docile (~> 1.1) @@ -73,30 +85,33 @@ GEM simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - standard (1.35.1) + standard (1.54.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.62.0) + rubocop (~> 1.84.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.3) + standard-performance (~> 1.8) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.3.1) + standard-performance (1.9.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.20.2) - stringio (3.1.0) - strscan (3.1.0) + rubocop-performance (~> 1.26.0) + stringio (3.2.0) timecop (0.9.10) - unicode-display_width (2.5.0) + tsort (0.2.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) PLATFORMS arm64-darwin-21 arm64-darwin-22 arm64-darwin-23 arm64-darwin-24 + arm64-darwin-25 x64-mingw-ucrt x64-mingw32 x86_64-darwin-19 diff --git a/README.md b/README.md index 21377ba9..db72cd8f 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,8 @@ | Supported Ruby Version | OS | | ------------ | --------------------- | -| Ruby 3.1.4 | Windows, MacOS, Linux | -| Ruby 3.2.3 | Windows, MacOS, Linux | -| Ruby 3.3.0 | Windows, MacOS, Linux | +| Ruby 3.4.x | Windows, MacOS, Linux | +| Ruby 4.0.x | Windows, MacOS, Linux | ### Install diff --git a/openfeature-sdk.gemspec b/openfeature-sdk.gemspec index 1c1aadce..fc7af8e2 100644 --- a/openfeature-sdk.gemspec +++ b/openfeature-sdk.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Ruby SDK for an the specifications for the open standard of feature flag management" spec.homepage = "https://github.com/open-feature/openfeature-ruby" spec.license = "Apache-2.0" - spec.required_ruby_version = ">= 3.1" + spec.required_ruby_version = ">= 3.4" spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com/open-feature/openfeature-ruby" From 9cf7a8962db357ebb6919714b84a648b617c3d10 Mon Sep 17 00:00:00 2001 From: Jose Colella Date: Thu, 5 Mar 2026 07:56:46 -0800 Subject: [PATCH 2/4] style: use short ruby version for linter CI job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Align the standard linter job's ruby-version with the matrix style convention — use "3.4" instead of pinning "3.4.8", letting ruby/setup-ruby resolve the latest patch. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Jose Colella --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 388c6620..5a5e7629 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.4.8 + ruby-version: "3.4" - run: bundle install - name: Standard run: bundle exec rake standard From 8e575840f7218b675783aab65d77fdea1be49bee Mon Sep 17 00:00:00 2001 From: Jose Colella Date: Thu, 5 Mar 2026 07:58:05 -0800 Subject: [PATCH 3/4] fix: upgrade simplecov-cobertura to v3 for Ruby 4.0 compatibility simplecov-cobertura 2.1.0 uses REXML APIs that are incompatible with Ruby 4.0's updated REXML parser, causing "Malformed XML: No root element" errors during coverage report generation. Version 3.x fixes this. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Jose Colella --- Gemfile.lock | 4 ++-- openfeature-sdk.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c797c5b5..3b87e695 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -82,7 +82,7 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-cobertura (2.1.0) + simplecov-cobertura (3.1.0) rexml simplecov (~> 0.19) simplecov-html (0.13.2) @@ -126,7 +126,7 @@ DEPENDENCIES rake (~> 13.0) rspec (~> 3.12.0) simplecov (~> 0.22.0) - simplecov-cobertura (~> 2.1.0) + simplecov-cobertura (~> 3.0) standard standard-performance timecop (~> 0.9.10) diff --git a/openfeature-sdk.gemspec b/openfeature-sdk.gemspec index fc7af8e2..d27ee460 100644 --- a/openfeature-sdk.gemspec +++ b/openfeature-sdk.gemspec @@ -38,6 +38,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "standard" spec.add_development_dependency "standard-performance" spec.add_development_dependency "simplecov", "~> 0.22.0" - spec.add_development_dependency "simplecov-cobertura", "~> 2.1.0" + spec.add_development_dependency "simplecov-cobertura", "~> 3.0" spec.add_development_dependency "timecop", "~> 0.9.10" end From 965e4134d51c04ab13679d58cacabfb85ca9f983 Mon Sep 17 00:00:00 2001 From: Jose Colella Date: Thu, 5 Mar 2026 08:11:48 -0800 Subject: [PATCH 4/4] style: fix EmptyLinesAfterModuleInclusion lint offenses Add required empty line after `include` statements flagged by the updated Standard/RuboCop rules. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Jose Colella --- spec/open_feature/sdk/hooks/hook_executor_spec.rb | 1 + spec/support/recording_hook_helper.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/spec/open_feature/sdk/hooks/hook_executor_spec.rb b/spec/open_feature/sdk/hooks/hook_executor_spec.rb index 28109b76..66f20510 100644 --- a/spec/open_feature/sdk/hooks/hook_executor_spec.rb +++ b/spec/open_feature/sdk/hooks/hook_executor_spec.rb @@ -155,6 +155,7 @@ def before(hook_context:, hints:) hook2_class = Class.new do include OpenFeature::SDK::Hooks::Hook + define_method(:initialize) { |log| @log = log } define_method(:before) do |hook_context:, hints:| diff --git a/spec/support/recording_hook_helper.rb b/spec/support/recording_hook_helper.rb index 71404fce..8e636e94 100644 --- a/spec/support/recording_hook_helper.rb +++ b/spec/support/recording_hook_helper.rb @@ -4,6 +4,7 @@ module RecordingHookHelper def recording_hook(name, call_log) Class.new do include OpenFeature::SDK::Hooks::Hook + define_method(:hook_name) { name } define_method(:before) do |hook_context:, hints:|