diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a937a2f..74d78d1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84c76b1..577c924 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml index 6f3b567..dc0a44d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,7 +13,7 @@ AllCops: - test/dummy/db/schema.rb - gemfiles/**/* - bin/**/* - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 # Department Bundler Bundler/DuplicatedGem: diff --git a/.ruby-version b/.ruby-version index e4604e3..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.1 +3.2.2 diff --git a/Appraisals b/Appraisals index 0766f14..4136390 100644 --- a/Appraisals +++ b/Appraisals @@ -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 diff --git a/Gemfile b/Gemfile index c73887e..96658ba 100644 --- a/Gemfile +++ b/Gemfile @@ -7,9 +7,12 @@ 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" @@ -17,4 +20,4 @@ gem "rubocop-rake" gem "simplecov" gem "sqlite3" -gem "activerecord", "~> 7.0" +gem "activerecord", "~> 7.1" diff --git a/gemfiles/activerecord_60.gemfile b/gemfiles/activerecord_71.gemfile similarity index 86% rename from gemfiles/activerecord_60.gemfile rename to gemfiles/activerecord_71.gemfile index cb269b2..eabade4 100644 --- a/gemfiles/activerecord_60.gemfile +++ b/gemfiles/activerecord_71.gemfile @@ -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: "../" diff --git a/lib/redi_search/index.rb b/lib/redi_search/index.rb index 7196331..f39fc9e 100644 --- a/lib/redi_search/index.rb +++ b/lib/redi_search/index.rb @@ -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 diff --git a/lib/redi_search/schema.rb b/lib/redi_search/schema.rb index ae0a712..776d137 100644 --- a/lib/redi_search/schema.rb +++ b/lib/redi_search/schema.rb @@ -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 diff --git a/redi_search.gemspec b/redi_search.gemspec index d673275..4ac94ed 100644 --- a/redi_search.gemspec +++ b/redi_search.gemspec @@ -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