Skip to content

Commit

Permalink
build: Remove support for Ruby 2.6 (EOL)
Browse files Browse the repository at this point in the history
  • Loading branch information
baygeldin committed Apr 21, 2022
1 parent 8a20d04 commit 52c6560
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
ruby:
- 2.6
- 2.7
- 3.1

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

strategy:
matrix:
ruby: ['2.6', '2.7', '3.0', '3.1']
ruby: ['2.7', '3.0', '3.1']
os: ['ubuntu-latest', 'macos-latest']

permissions:
Expand Down
7 changes: 1 addition & 6 deletions lib/tantiny/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,7 @@ def search(query, limit: DEFAULT_LIMIT, **smart_query_options)
Query::TYPES.each do |query_type|
method_name = "#{query_type}_query"
define_method(method_name) do |*args, **kwargs|
# Ruby 2.6 fix (https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)
if kwargs.empty?
Query.send(method_name, self, *args)
else
Query.send(method_name, self, *args, **kwargs)
end
Query.send(method_name, self, *args, **kwargs)
end
end

Expand Down
5 changes: 3 additions & 2 deletions spec/tantiny/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,11 @@ def documents
describe ".#{method_name}" do
it "forwards args to Query" do
any_args = [1, 2, 3]
any_kwargs = {foo: :bar}

expect(Tantiny::Query).to receive(method_name).with(index, *any_args)
expect(Tantiny::Query).to receive(method_name).with(index, *any_args, **any_kwargs)

index.send(method_name, *any_args)
index.send(method_name, *any_args, **any_kwargs)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion tantiny.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
"source_code_uri" => "https://github.com/baygeldin/tantiny"
}

spec.required_ruby_version = ">= 2.6"
spec.required_ruby_version = ">= 2.7"

spec.files = [
Dir.glob("bin/**/*"),
Expand Down

0 comments on commit 52c6560

Please sign in to comment.