Skip to content

Commit

Permalink
Drop support for ruby 2.7 and rails 6.0. Add support for rails 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Nov 23, 2023
1 parent a2ab1e6 commit fec4716
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.1
- uses: actions/checkout@v4
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
- name: Install rubocop
run: |
gem install rubocop rubocop-performance rubocop-minitest rubocop-rake
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.7', '3.0', '3.1' ]
gemfile: [ 'Gemfile', 'gemfiles/activerecord_60.gemfile', 'gemfiles/activerecord_61.gemfile', 'gemfiles/activerecord_70.gemfile' ]
ruby: [ '3.0', '3.1', '3.2' ]
gemfile: [ 'Gemfile', 'gemfiles/activerecord_61.gemfile', 'gemfiles/activerecord_70.gemfile', 'gemfiles/activerecord_71.gemfile' ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
Expand All @@ -38,11 +38,11 @@ jobs:
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 3.1
- uses: actions/checkout@v4
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
- name: Install dependencies
run: |
sudo apt-get install libsqlite3-dev -y
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AllCops:
- test/dummy/db/schema.rb
- gemfiles/**/*
- bin/**/*
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0

# Department Bundler
Bundler/DuplicatedGem:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.1
3.2.2
10 changes: 5 additions & 5 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# frozen_string_literal: true

appraise "activerecord-60" do
gem "activerecord", "< 6.1", ">= 6.0"
end

appraise "activerecord-61" do
gem "activerecord", "< 6.2", ">= 6.1"
end

appraise "activerecord-70" do
gem "activerecord", "~> 7.0.0.alpha1"
gem "activerecord", "~> 7.0.0"
end

appraise "activerecord-70" do
gem "activerecord", "~> 7.1.0"
end
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
gemspec

gem "appraisal", "~> 2.2"
gem "bundler", ">= 1.17", "< 3"
gem "debug"
gem "faker"
gem "minitest", "~> 5.0"
gem "mocha"
gem "rake", "~> 13.0"
gem "rubocop"
gem "rubocop-minitest"
gem "rubocop-performance"
gem "rubocop-rake"
gem "simplecov"
gem "sqlite3"

gem "activerecord", "~> 7.0"
gem "activerecord", "~> 7.1"
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ gem "rubocop-minitest"
gem "rubocop-performance"
gem "simplecov"
gem "sqlite3"
gem "activerecord", "< 6.1", ">= 6.0"
gem "activerecord", "~> 7.1.0"

gemspec path: "../"
4 changes: 2 additions & 2 deletions lib/redi_search/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def document_count
info.num_docs.to_i
end

def add_field(name, type, **options, &block)
AddField.new(self, name, type, **options, &block).call!
def add_field(_name, _type, ...)
AddField.new(...).call!
end

private
Expand Down
20 changes: 10 additions & 10 deletions lib/redi_search/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ def initialize(&block)
instance_exec(&block)
end

def text_field(name, **options, &block)
self[name] || push(Schema::TextField.new(name, **options, &block))
def text_field(name, ...)
self[name] || push(Schema::TextField.new(name, ...))
end

def numeric_field(name, **options, &block)
self[name] || push(Schema::NumericField.new(name, **options, &block))
def numeric_field(name, ...)
self[name] || push(Schema::NumericField.new(name, ...))
end

def tag_field(name, **options, &block)
self[name] || push(Schema::TagField.new(name, **options, &block))
def tag_field(name, ...)
self[name] || push(Schema::TagField.new(name, ...))
end

def geo_field(name, **options, &block)
self[name] || push(Schema::GeoField.new(name, **options, &block))
def geo_field(name, ...)
self[name] || push(Schema::GeoField.new(name, ...))
end

def add_field(name, type, **options, &block)
def add_field(name, type, ...)
case type
when :text then method(:text_field)
when :numeric then method(:numeric_field)
when :tag then method(:tag_field)
when :geo then method(:geo_field)
end.call(name, **options, &block)
end.call(name, ...)
end

def to_a
Expand Down
8 changes: 2 additions & 6 deletions redi_search.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,9 @@ Gem::Specification.new do |spec|
"changelog_uri" => "https://github.com/npezza93/redi_search/releases",
}

spec.required_ruby_version = ">= 2.7.0"
spec.required_ruby_version = ">= 3.0"

spec.add_runtime_dependency "activesupport", ">= 5.1", "< 7.1"
spec.add_runtime_dependency "activesupport", ">= 5.1", "< 8.0"
spec.add_runtime_dependency "redis", ">= 4.0", "< 6.0"
spec.add_runtime_dependency "zeitwerk"

spec.add_development_dependency "bundler", ">= 1.17", "< 3"
spec.add_development_dependency "minitest", "~> 5.0"
spec.add_development_dependency "rake", "~> 13.0"
end

0 comments on commit fec4716

Please sign in to comment.