feat: add Ruby 4.0 support#444
Open
direktar wants to merge 1 commit into
Open
Conversation
- Add Ruby 4.0 to CI test matrix
- Update RuboCop TargetRubyVersion to 4.0
- Replace =~ + Regexp.last_match with thread-safe .match()/.match?()
- Fix unintentional regex [\d+]{0,} -> \d+ in arel_tosql.rb
- Bump version to 11.2.0
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.
Add Ruby 4.0 support
Changes
CI & tooling
'4.0'to the Ruby version matrix in.github/workflows/tests.ymlTargetRubyVersionfrom3.0to4.011.2.0Code modernization (Ruby 4 best practices)
Replace
=~+Regexp.last_matchwith thread-safe.match()/.match?()throughout:oid/spatial.rb—parse_sql_typenow uses local match variables instead ofrelying on the global
Regexp.last_matchside-effectcolumn.rb— replace!!(str =~ /regex/)withstr.match?(/regex/)spatial_column_info.rb— same patternarel_tosql.rb— use.match?()and fix the regex[\d+]{0,}→\d+(the original character class
[\d+]was unintentional)Testing
Tested locally against PostGIS 17-3.5 on Ruby 4.0.5.
All 67 adapter-specific tests pass (
rake test:postgis).The single pre-existing failure in the full suite (
BasicsTest#test_mutating_time_objects)is a timezone issue in the Rails test suite itself, unrelated to this PR —
it fails identically on the unmodified
masteron both Ruby 3.4.3 and Ruby 4.0.5.