From e8c724343aaaf9eff63e74e65d06c4c828d3c807 Mon Sep 17 00:00:00 2001 From: Erim Icel Date: Mon, 27 Apr 2026 18:11:26 +0100 Subject: [PATCH] chore: drop Ruby 2.7 support 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). --- .rubocop.yml | 2 +- spec/typesense/collections_spec.rb | 2 +- typesense.gemspec | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 64c0c3e..520d912 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ plugins: rubocop-rspec AllCops: NewCops: enable - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 Style/Documentation: Enabled: false diff --git a/spec/typesense/collections_spec.rb b/spec/typesense/collections_spec.rb index 38db69d..031fddd 100644 --- a/spec/typesense/collections_spec.rb +++ b/spec/typesense/collections_spec.rb @@ -36,7 +36,7 @@ describe '#create' do it 'creates a collection and returns it' do # since num_documents is a read-only attribute - schema_for_creation = company_schema.reject { |key, _| key == 'num_documents' } + schema_for_creation = company_schema.except('num_documents') stub_request(:post, Typesense::ApiCall.new(typesense.configuration).send(:uri_for, '/collections', typesense.configuration.nodes[0])) .with(body: schema_for_creation, diff --git a/typesense.gemspec b/typesense.gemspec index f585e92..8f99e29 100644 --- a/typesense.gemspec +++ b/typesense.gemspec @@ -15,9 +15,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://typesense.org' spec.license = 'Apache-2.0' - # rubocop:disable Gemspec/RequiredRubyVersion, Lint/RedundantCopDisableDirective - spec.required_ruby_version = '>= 2.7' - # rubocop:enable Gemspec/RequiredRubyVersion, Lint/RedundantCopDisableDirective + spec.required_ruby_version = '>= 3.0' spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/})