Skip to content

chore: drop Ruby 2.7 support#62

Open
erimicel wants to merge 1 commit intotypesense:masterfrom
OLIOEX:drop-ruby-2.7
Open

chore: drop Ruby 2.7 support#62
erimicel wants to merge 1 commit intotypesense:masterfrom
OLIOEX:drop-ruby-2.7

Conversation

@erimicel
Copy link
Copy Markdown
Contributor

@erimicel erimicel commented Apr 27, 2026

Ruby 2.7 has been EOL since March 2023, and the CI matrix in .github/workflows/tests.yml only covers 3.0, 3.2, 3.3, 3.4 — 2.7 hasn't been tested for some time. This PR makes the gemspec and rubocop config match what CI actually exercises.

Changes

  • typesense.gemspec: bump required_ruby_version from >= 2.7 to >= 3.0. The # rubocop:disable Gemspec/RequiredRubyVersion, Lint/RedundantCopDisableDirective workaround is no longer needed once the floor matches the rubocop target, so it's removed.
  • .rubocop.yml: bump TargetRubyVersion from 2.7 to 3.0.
  • spec/typesense/collections_spec.rb: rubocop autocorrect from the newly-enabled Style/HashExcept cop (Hash#except was added in 3.0). One line changes from reject { |key, _| key == 'num_documents' } to .except('num_documents').

Compatibility note

This is a breaking change for anyone still installing the gem on Ruby 2.7. They will see a Gem::RuntimeRequirementNotMetError from bundler. The workaround for those users is pinning to the previous gem version. Worth tagging this in the next release notes / a major version bump if prefer.

Verification

  • bundle exec rubocop — 97 files inspected, no offenses detected.
  • bundle exec rspec spec/typesense/collections_spec.rb:38 (the touched example) — passes.

PR Checklist

Ruby 2.7 has been EOL since March 2023, and the CI matrix already only
covers 3.0+. The gemspec was lagging behind reality, claiming 2.7
support while CI never tested it.

- `typesense.gemspec`: bump `required_ruby_version` from `>= 2.7` to
  `>= 3.0`. The `# rubocop:disable Gemspec/RequiredRubyVersion` workaround
  is no longer needed once the floor matches the rubocop target.
- `.rubocop.yml`: bump `TargetRubyVersion` to 3.0.
- `spec/typesense/collections_spec.rb`: rubocop autocorrect from the
  newly-enabled `Style/HashExcept` cop (`Hash#except` was added in 3.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