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 +4 -4
- data/.github/workflows/tests.yml +3 -3
- data/.rubocop.yml +1 -1
- data/Appraisals +4 -0
- data/gemfiles/activerecord_70.gemfile +15 -0
- data/lib/redi_search/client.rb +1 -1
- data/lib/redi_search/document/display.rb +4 -4
- data/lib/redi_search/document.rb +2 -2
- data/lib/redi_search/lazily_load.rb +2 -2
- data/lib/redi_search/log_subscriber.rb +2 -2
- data/lib/redi_search/schema/field.rb +2 -2
- data/lib/redi_search/search/result.rb +2 -2
- data/lib/redi_search/search.rb +1 -1
- data/lib/redi_search/spellcheck/result.rb +4 -4
- data/lib/redi_search/spellcheck.rb +1 -1
- data/lib/redi_search/version.rb +1 -1
- data/redi_search.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 140fad214c11689ac648949c29c17409c96164ca68e9c6cc5cb694b291aa685c
|
4
|
+
data.tar.gz: 7ba282b0a28eb08c5a8064d3d26afd6c1b97935991f55bd5b69ff50c5a3b7eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df96fa21f24f4fec24c66c64b447775a01eb9de86fbf5b30fd028a101363f8036e612d2a2d9b49ed4f09c6dcc14bbcbe7f9a9893be5dcc4dcec7aa4a75db9c95
|
7
|
+
data.tar.gz: 63c12659be3dc7fdfd790c5f4bab980e970ae5943273c2bda750ba0b43c0ddab50390cb718193130ee7658dd6b6384eed96881619ce49699bb7914c5687643fc
|
data/.github/workflows/tests.yml
CHANGED
@@ -11,8 +11,8 @@ jobs:
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
|
-
ruby: [ '2.
|
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.
|
34
|
+
image: redislabs/redisearch:2.0.12
|
35
35
|
ports:
|
36
36
|
- 6379:6379
|
37
37
|
steps:
|
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
@@ -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: "../"
|
data/lib/redi_search/client.rb
CHANGED
@@ -4,9 +4,9 @@ module RediSearch
|
|
4
4
|
class Document
|
5
5
|
module Display
|
6
6
|
def inspect
|
7
|
-
inspection = pretty_print_attributes.
|
7
|
+
inspection = pretty_print_attributes.filter_map do |field_name|
|
8
8
|
"#{field_name}: #{public_send(field_name)}"
|
9
|
-
end.
|
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
|
-
|
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
|
-
|
38
|
+
# :nocov:
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/redi_search/document.rb
CHANGED
@@ -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).
|
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.
|
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
|
-
|
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
|
-
|
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
|
-
|
15
|
+
# :nocov:
|
16
16
|
def self.reset_runtime
|
17
17
|
rt, self.runtime = runtime, 0
|
18
18
|
rt
|
19
19
|
end
|
20
|
-
|
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.
|
21
|
+
boolean_options.filter_map do |option|
|
22
22
|
option.to_s.upcase.split("_").join unless
|
23
23
|
FALSES.include?(send(option))
|
24
|
-
end
|
24
|
+
end
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/redi_search/search.rb
CHANGED
@@ -15,14 +15,14 @@ module RediSearch
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def inspect
|
18
|
-
inspection = %w(term suggestions).
|
18
|
+
inspection = %w(term suggestions).filter_map do |field_name|
|
19
19
|
"#{field_name}: #{public_send(field_name)}"
|
20
|
-
end.
|
20
|
+
end.join(", ")
|
21
21
|
|
22
22
|
"#<#{self.class} #{inspection}>"
|
23
23
|
end
|
24
24
|
|
25
|
-
|
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
|
-
|
41
|
+
# :nocov:
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/redi_search/version.rb
CHANGED
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.
|
27
|
+
spec.required_ruby_version = ">= 2.7.0"
|
28
28
|
|
29
|
-
spec.add_runtime_dependency "activesupport", ">= 5.1", "<
|
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
|
+
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-
|
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: '
|
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: '
|
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.
|
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.
|
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
|