Skip to content

Commit e8c7243

Browse files
committed
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).
1 parent f33f224 commit e8c7243

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins: rubocop-rspec
22

33
AllCops:
44
NewCops: enable
5-
TargetRubyVersion: 2.7
5+
TargetRubyVersion: 3.0
66

77
Style/Documentation:
88
Enabled: false

spec/typesense/collections_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
describe '#create' do
3737
it 'creates a collection and returns it' do
3838
# since num_documents is a read-only attribute
39-
schema_for_creation = company_schema.reject { |key, _| key == 'num_documents' }
39+
schema_for_creation = company_schema.except('num_documents')
4040

4141
stub_request(:post, Typesense::ApiCall.new(typesense.configuration).send(:uri_for, '/collections', typesense.configuration.nodes[0]))
4242
.with(body: schema_for_creation,

typesense.gemspec

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ Gem::Specification.new do |spec|
1515
spec.homepage = 'https://typesense.org'
1616
spec.license = 'Apache-2.0'
1717

18-
# rubocop:disable Gemspec/RequiredRubyVersion, Lint/RedundantCopDisableDirective
19-
spec.required_ruby_version = '>= 2.7'
20-
# rubocop:enable Gemspec/RequiredRubyVersion, Lint/RedundantCopDisableDirective
18+
spec.required_ruby_version = '>= 3.0'
2119

2220
spec.files = `git ls-files -z`.split("\x0").reject do |f|
2321
f.match(%r{^(test|spec|features)/})

0 commit comments

Comments
 (0)