Skip to content

feat: add Ruby 4.0 support#444

Open
direktar wants to merge 1 commit into
rgeo:masterfrom
direktar:ruby-4-support
Open

feat: add Ruby 4.0 support#444
direktar wants to merge 1 commit into
rgeo:masterfrom
direktar:ruby-4-support

Conversation

@direktar

@direktar direktar commented Jun 9, 2026

Copy link
Copy Markdown

Add Ruby 4.0 support

Changes

CI & tooling

  • Add '4.0' to the Ruby version matrix in .github/workflows/tests.yml
  • Update RuboCop TargetRubyVersion from 3.0 to 4.0
  • Bump version to 11.2.0

Code modernization (Ruby 4 best practices)

Replace =~ + Regexp.last_match with thread-safe .match() / .match?() throughout:

  • oid/spatial.rbparse_sql_type now uses local match variables instead of
    relying on the global Regexp.last_match side-effect
  • column.rb — replace !!(str =~ /regex/) with str.match?(/regex/)
  • spatial_column_info.rb — same pattern
  • arel_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 master on both Ruby 3.4.3 and Ruby 4.0.5.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant