Repository navigation
Require Ruby 3.2 or newer - #1866
Draft
neilvcarvalho wants to merge 4 commits into
Draft
neilvcarvalho wants to merge 4 commits into
neilvcarvalho wants to merge 4 commits into
Conversation
Ruby 3.1 reached end of life in March 2025, and upcoming refactoring needs Data.define, which is only available from Ruby 3.2 onwards. This commit raises required_ruby_version in the gemspec to 3.2.0 and removes Ruby 3.1 from the build matrix together with its exclusions. JRuby 9.4 is removed as well because it implements Ruby 3.1; JRuby 10 stays in the matrix. Users still on Ruby 3.1 or JRuby 9.4 will not be able to install releases that include this change and will stay on the last compatible version.
Ruby 3.2 makes Set available without requiring it, and standard reports the explicit require as Lint/RedundantRequireStatement once it targets Ruby 3.2. This commit removes the require now that the gemspec guarantees Ruby 3.2 or newer. There is no behavior change.
The gemspec now requires Ruby 3.2 or newer, so standard no longer needs to restrict itself to syntax that parses on Ruby 3.1. Raising the target lets the linter use rules that assume 3.2 features. Running standard with the new target reports no offenses.
The gemspec now requires Ruby 3.2 or newer. Users upgrading need to know that releases including this change will not install on Ruby 3.1, so record it in the unreleased section of the changelog.
neilvcarvalho
marked this pull request as draft
November 27, 2026 20:14
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruby 3.1 reached end of life in March 2025. An upcoming refactoring step converts internal value objects to
Data.define, which needs Ruby 3.2. This pull request raises the floor in the same way as #1843 did for Ruby 3.1. It uses no Ruby 3.2 feature inlib/beyond dropping a require that 3.2 makes redundant.Changes
factory_bot.gemspec:required_ruby_versionis now>= 3.2.0..github/workflows/build.yml: Ruby 3.1 and its threeexcludeentries are removed from the matrix.jruby-9.4and itsexcludeentries are removed too, because it implements Ruby 3.1.jruby-10stays.lib/factory_bot.rb:require "set"is removed. Standard reports it asLint/RedundantRequireStatementonce it targets Ruby 3.2, sinceSetis available without a require from 3.2 onwards..standard.yml:ruby_versionis now"3.2".NEWS.md: an "Unreleased" entry records the dropped version.No documentation states a minimum Ruby version (the README points at the build workflow), and
Gemfile.lockdoes not change.Side effects
Users on Ruby 3.1 or JRuby 9.4 will not be able to install releases that include this change and will stay on the last compatible version.
Verification
On the default gemfile with Ruby 4.0.10:
bundle exec rake all_specs: 312 unit examples, 457 acceptance examples and 4 cucumber scenarios, all passing.bundle exec standardrb: 149 files inspected, no offenses.