redi_search 4.1.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ae66b8370802c6acf6c50487cc751e526bd7afa69be14bf56e0e5b8db416511
4
- data.tar.gz: ccffbbb3db86598eb132225091cf3cfae3bfac692bca430d2484e7c97f0ab81c
3
+ metadata.gz: 140fad214c11689ac648949c29c17409c96164ca68e9c6cc5cb694b291aa685c
4
+ data.tar.gz: 7ba282b0a28eb08c5a8064d3d26afd6c1b97935991f55bd5b69ff50c5a3b7eec
5
5
  SHA512:
6
- metadata.gz: 037fd2b21e9e296e3b143f4d878a9e9cb37406f99c66b22f54a218d1a3d12c046034b19d011b875b2cd5ab3d9a1bb81c4f10b4c862196d01e8a408a2d6436156
7
- data.tar.gz: 17e0f4dccd59d130c3d76314cff4b2a94da725b1b5bdc2478aaf39dde5c3a34d178cbafb04db45bf5488a8a7006bb043ed14247e46a47a64d362cc94b6fe52f1
6
+ metadata.gz: df96fa21f24f4fec24c66c64b447775a01eb9de86fbf5b30fd028a101363f8036e612d2a2d9b49ed4f09c6dcc14bbcbe7f9a9893be5dcc4dcec7aa4a75db9c95
7
+ data.tar.gz: 63c12659be3dc7fdfd790c5f4bab980e970ae5943273c2bda750ba0b43c0ddab50390cb718193130ee7658dd6b6384eed96881619ce49699bb7914c5687643fc
@@ -11,8 +11,8 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby: [ '2.5', '2.6', '2.7', '3.0' ]
15
- gemfile: [ 'Gemfile', 'gemfiles/activerecord_60.gemfile' ]
14
+ ruby: [ '2.7', '3.0' ]
15
+ gemfile: [ 'Gemfile', 'gemfiles/activerecord_60.gemfile', 'gemfiles/activerecord_61.gemfile', 'gemfiles/activerecord_70.gemfile' ]
16
16
  steps:
17
17
  - uses: actions/checkout@v2
18
18
  - name: Set up Ruby ${{ matrix.ruby }}
@@ -31,7 +31,7 @@ jobs:
31
31
  runs-on: ubuntu-latest
32
32
  services:
33
33
  redisearch:
34
- image: redislabs/redisearch:2.0.6
34
+ image: redislabs/redisearch:2.0.12
35
35
  ports:
36
36
  - 6379:6379
37
37
  steps:
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  - test/dummy/db/schema.rb
14
14
  - gemfiles/**/*
15
15
  - bin/**/*
16
- TargetRubyVersion: 2.5
16
+ TargetRubyVersion: 2.7
17
17
 
18
18
  # Department Bundler
19
19
  Bundler/DuplicatedGem:
data/Appraisals CHANGED
@@ -7,3 +7,7 @@ end
7
7
  appraise "activerecord-61" do
8
8
  gem "activerecord", "< 6.2", ">= 6.1"
9
9
  end
10
+
11
+ appraise "activerecord-70" do
12
+ gem "activerecord", "~> 7.0.0.alpha1"
13
+ end
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.2"
6
+ gem "faker"
7
+ gem "mocha"
8
+ gem "rubocop"
9
+ gem "rubocop-minitest"
10
+ gem "rubocop-performance"
11
+ gem "simplecov"
12
+ gem "sqlite3"
13
+ gem "activerecord", "~> 7.0.0.alpha1"
14
+
15
+ gemspec path: "../"
@@ -47,7 +47,7 @@ module RediSearch
47
47
  "action.redi_search",
48
48
  { name: "RediSearch", action: action, inside_pipeline: pipeline }.
49
49
  merge(payload),
50
- &Proc.new(&(block || proc {})) # rubocop:disable Lint/EmptyBlock
50
+ &Proc.new(&(block || proc {}))
51
51
  )
52
52
  end
53
53
  end
@@ -4,9 +4,9 @@ module RediSearch
4
4
  class Document
5
5
  module Display
6
6
  def inspect
7
- inspection = pretty_print_attributes.map do |field_name|
7
+ inspection = pretty_print_attributes.filter_map do |field_name|
8
8
  "#{field_name}: #{public_send(field_name)}"
9
- end.compact.join(", ")
9
+ end.join(", ")
10
10
 
11
11
  "#<#{self.class} #{inspection}>"
12
12
  end
@@ -19,7 +19,7 @@ module RediSearch
19
19
  pp_attrs.compact
20
20
  end
21
21
 
22
- #:nocov:
22
+ # :nocov:
23
23
  def pretty_print(printer) # rubocop:disable Metrics/MethodLength
24
24
  printer.object_address_group(self) do
25
25
  printer.seplist(
@@ -35,7 +35,7 @@ module RediSearch
35
35
  end
36
36
  end
37
37
  end
38
- #:nocov:
38
+ # :nocov:
39
39
  end
40
40
  end
41
41
  end
@@ -11,11 +11,11 @@ module RediSearch
11
11
  def for_object(index, record, serializer: nil, only: [])
12
12
  object_to_serialize = serializer&.new(record) || record
13
13
 
14
- field_values = index.schema.fields.map(&:name).map do |field|
14
+ field_values = index.schema.fields.map(&:name).filter_map do |field|
15
15
  next unless only.empty? || only.include?(field)
16
16
 
17
17
  [field.to_s, object_to_serialize.public_send(field)]
18
- end.compact.to_h
18
+ end.to_h
19
19
 
20
20
  new(index, object_to_serialize.id, field_values)
21
21
  end
@@ -30,7 +30,7 @@ module RediSearch
30
30
  end
31
31
  end
32
32
 
33
- #:nocov:
33
+ # :nocov:
34
34
  def pretty_print(printer)
35
35
  execute_and_rescue_inspection do
36
36
  return super(inspect) unless valid?
@@ -38,7 +38,7 @@ module RediSearch
38
38
  printer.pp(documents)
39
39
  end
40
40
  end
41
- #:nocov:
41
+ # :nocov:
42
42
 
43
43
  private
44
44
 
@@ -12,12 +12,12 @@ module RediSearch
12
12
  Thread.current[:redi_search_runtime] ||= 0
13
13
  end
14
14
 
15
- #:nocov:
15
+ # :nocov:
16
16
  def self.reset_runtime
17
17
  rt, self.runtime = runtime, 0
18
18
  rt
19
19
  end
20
- #:nocov:
20
+ # :nocov:
21
21
 
22
22
  def action(event)
23
23
  self.class.runtime += event.duration
@@ -18,10 +18,10 @@ module RediSearch
18
18
  ].freeze
19
19
 
20
20
  def boolean_options_string
21
- boolean_options.map do |option|
21
+ boolean_options.filter_map do |option|
22
22
  option.to_s.upcase.split("_").join unless
23
23
  FALSES.include?(send(option))
24
- end.compact
24
+ end
25
25
  end
26
26
  end
27
27
  end
@@ -26,11 +26,11 @@ module RediSearch
26
26
  results
27
27
  end
28
28
 
29
- #:nocov:
29
+ # :nocov:
30
30
  def pretty_print(printer)
31
31
  printer.pp(results)
32
32
  end
33
- #:nocov:
33
+ # :nocov:
34
34
 
35
35
  private
36
36
 
@@ -54,7 +54,7 @@ module RediSearch
54
54
  end
55
55
 
56
56
  def parse_response(response)
57
- @documents = Result.new(self, response[0], response[1..-1])
57
+ @documents = Result.new(self, response[0], response[1..])
58
58
  end
59
59
 
60
60
  def valid?
@@ -15,14 +15,14 @@ module RediSearch
15
15
  end
16
16
 
17
17
  def inspect
18
- inspection = %w(term suggestions).map do |field_name|
18
+ inspection = %w(term suggestions).filter_map do |field_name|
19
19
  "#{field_name}: #{public_send(field_name)}"
20
- end.compact.join(", ")
20
+ end.join(", ")
21
21
 
22
22
  "#<#{self.class} #{inspection}>"
23
23
  end
24
24
 
25
- #:nocov:
25
+ # :nocov:
26
26
  def pretty_print(printer) # rubocop:disable Metrics/MethodLength
27
27
  printer.object_address_group(self) do
28
28
  printer.seplist(
@@ -38,7 +38,7 @@ module RediSearch
38
38
  end
39
39
  end
40
40
  end
41
- #:nocov:
41
+ # :nocov:
42
42
  end
43
43
  end
44
44
  end
@@ -27,7 +27,7 @@ module RediSearch
27
27
  end
28
28
 
29
29
  def parsed_terms
30
- terms.split(Regexp.union(",.<>{}[]\"':;!@#$%^&*()-+=~\s".split("")))
30
+ terms.split(Regexp.union(",.<>{}[]\"':;!@#$%^&*()-+=~\s".chars))
31
31
  end
32
32
 
33
33
  def execute
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RediSearch
4
- VERSION = "4.1.0"
4
+ VERSION = "5.0.0"
5
5
  end
data/redi_search.gemspec CHANGED
@@ -24,9 +24,9 @@ Gem::Specification.new do |spec|
24
24
  spec.metadata["changelog_uri"] =
25
25
  "https://github.com/npezza93/redi_search/releases"
26
26
 
27
- spec.required_ruby_version = ">= 2.5.0"
27
+ spec.required_ruby_version = ">= 2.7.0"
28
28
 
29
- spec.add_runtime_dependency "activesupport", ">= 5.1", "< 6.2"
29
+ spec.add_runtime_dependency "activesupport", ">= 5.1", "< 7.1"
30
30
  spec.add_runtime_dependency "redis", ">= 4.0", "< 5.0"
31
31
 
32
32
  spec.add_development_dependency "bundler", ">= 1.17", "< 3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redi_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-14 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.2'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.2'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: redis
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -123,6 +123,7 @@ files:
123
123
  - gemfiles/.bundle/config
124
124
  - gemfiles/activerecord_60.gemfile
125
125
  - gemfiles/activerecord_61.gemfile
126
+ - gemfiles/activerecord_70.gemfile
126
127
  - lib/redi_search.rb
127
128
  - lib/redi_search/add_field.rb
128
129
  - lib/redi_search/client.rb
@@ -187,14 +188,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
188
  requirements:
188
189
  - - ">="
189
190
  - !ruby/object:Gem::Version
190
- version: 2.5.0
191
+ version: 2.7.0
191
192
  required_rubygems_version: !ruby/object:Gem::Requirement
192
193
  requirements:
193
194
  - - ">="
194
195
  - !ruby/object:Gem::Version
195
196
  version: '0'
196
197
  requirements: []
197
- rubygems_version: 3.2.8
198
+ rubygems_version: 3.2.22
198
199
  signing_key:
199
200
  specification_version: 4
200
201
  summary: RediSearch ruby wrapper that can integrate with Rails