zelastic 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 118f50ebd50d4291a03b2274b4129a9d69e15aee8b744ce986524ab3a7496845
4
- data.tar.gz: ef294b31041ecf9a0cdae04008950eb76fd2e19c60058db234b19549dd646ea6
3
+ metadata.gz: 2f54a69201807f3ba79aa72f7ea5b51c1adfebcdc06d4b51f4662f49c96bc0c7
4
+ data.tar.gz: '0480ef88c0c3f3f170c18712d2e9208b4fbcd0f7614abbb9cb9b89d2636443be'
5
5
  SHA512:
6
- metadata.gz: d22f6e8c566c3e400ab3d02e3a4fe6f6aa114ac00533ca42848058a297e2593450f3cefebb19206d21acaf5d62da74f08ad247be137af07404e9bdc388faf900
7
- data.tar.gz: 7e369fe3a13e13289e98ee18e1b55cd83c0034a85ab3e0282a4ab70c302b05b41cbb7a329a69261880285e437f42e654ad332e2143f08babda5efbc5f54e1208
6
+ metadata.gz: 4ba1d3c04f92728c3a414a3b09551117c664eeb3e1ec9e4f395bb393b33cc8de55bb4239da17fd98be0a8171f3ae038a769f3a2b93147abf42fcac8a13ab0254
7
+ data.tar.gz: 954fe26c4ed02e57e00ae29c82f26b1eba33f6c637e520db7610a220a851b9d158f4052a9323c506804247b8f527115ce808401cb42c1a893ab93d64f9025a34
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  references:
2
2
  ruby: &ruby
3
- image: carwow/ruby-ci:2.4.4
3
+ image: carwow/ruby-ci:2.6
4
4
  environment:
5
5
  ELASTICSEARCH_URL: http://localhost:9200
6
6
 
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: '09:00'
8
+ timezone: 'Europe/London'
9
+ open-pull-requests-limit: 10
data/Gemfile.lock CHANGED
@@ -1,78 +1,94 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zelastic (0.6.0)
4
+ zelastic (0.6.2)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (5.1.4)
11
- activesupport (= 5.1.4)
12
- activerecord (5.1.4)
13
- activemodel (= 5.1.4)
14
- activesupport (= 5.1.4)
15
- arel (~> 8.0)
16
- activesupport (5.1.4)
10
+ activemodel (6.1.3)
11
+ activesupport (= 6.1.3)
12
+ activerecord (6.1.3)
13
+ activemodel (= 6.1.3)
14
+ activesupport (= 6.1.3)
15
+ activesupport (6.1.3)
17
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (~> 0.7)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- arel (8.0.0)
22
- ast (2.3.0)
23
- coderay (1.1.2)
24
- concurrent-ruby (1.0.5)
25
- diff-lcs (1.3)
26
- elasticsearch (6.0.2)
27
- elasticsearch-api (= 6.0.2)
28
- elasticsearch-transport (= 6.0.2)
29
- elasticsearch-api (6.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ ast (2.4.1)
22
+ carwow_rubocop (3.3.0)
23
+ rubocop (>= 0.78)
24
+ rubocop-performance
25
+ rubocop-rspec
26
+ coderay (1.1.3)
27
+ concurrent-ruby (1.1.8)
28
+ diff-lcs (1.4.4)
29
+ elasticsearch (7.11.2)
30
+ elasticsearch-api (= 7.11.2)
31
+ elasticsearch-transport (= 7.11.2)
32
+ elasticsearch-api (7.11.2)
30
33
  multi_json
31
- elasticsearch-transport (6.0.2)
32
- faraday
34
+ elasticsearch-transport (7.11.2)
35
+ faraday (~> 1)
33
36
  multi_json
34
- faraday (0.15.2)
37
+ faraday (1.3.0)
38
+ faraday-net_http (~> 1.0)
35
39
  multipart-post (>= 1.2, < 3)
36
- i18n (0.9.1)
40
+ ruby2_keywords
41
+ faraday-net_http (1.0.1)
42
+ i18n (1.8.9)
37
43
  concurrent-ruby (~> 1.0)
38
- method_source (0.9.0)
39
- minitest (5.11.1)
40
- multi_json (1.13.1)
41
- multipart-post (2.0.0)
42
- parallel (1.12.1)
43
- parser (2.4.0.2)
44
- ast (~> 2.3)
45
- powerpack (0.1.1)
46
- pry (0.11.3)
47
- coderay (~> 1.1.0)
48
- method_source (~> 0.9.0)
44
+ method_source (1.0.0)
45
+ minitest (5.14.3)
46
+ multi_json (1.15.0)
47
+ multipart-post (2.1.1)
48
+ parallel (1.19.1)
49
+ parser (2.7.1.3)
50
+ ast (~> 2.4.0)
51
+ pry (0.14.0)
52
+ coderay (~> 1.1)
53
+ method_source (~> 1.0)
49
54
  rainbow (3.0.0)
50
- rake (13.0.1)
51
- rspec (3.7.0)
52
- rspec-core (~> 3.7.0)
53
- rspec-expectations (~> 3.7.0)
54
- rspec-mocks (~> 3.7.0)
55
- rspec-core (3.7.1)
56
- rspec-support (~> 3.7.0)
57
- rspec-expectations (3.7.0)
55
+ rake (13.0.3)
56
+ regexp_parser (1.7.1)
57
+ rexml (3.2.4)
58
+ rspec (3.10.0)
59
+ rspec-core (~> 3.10.0)
60
+ rspec-expectations (~> 3.10.0)
61
+ rspec-mocks (~> 3.10.0)
62
+ rspec-core (3.10.0)
63
+ rspec-support (~> 3.10.0)
64
+ rspec-expectations (3.10.0)
58
65
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.7.0)
60
- rspec-mocks (3.7.0)
66
+ rspec-support (~> 3.10.0)
67
+ rspec-mocks (3.10.0)
61
68
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.7.0)
63
- rspec-support (3.7.0)
64
- rubocop (0.52.1)
69
+ rspec-support (~> 3.10.0)
70
+ rspec-support (3.10.0)
71
+ rubocop (0.85.1)
65
72
  parallel (~> 1.10)
66
- parser (>= 2.4.0.2, < 3.0)
67
- powerpack (~> 0.1)
73
+ parser (>= 2.7.0.1)
68
74
  rainbow (>= 2.2.2, < 4.0)
75
+ regexp_parser (>= 1.7)
76
+ rexml
77
+ rubocop-ast (>= 0.0.3)
69
78
  ruby-progressbar (~> 1.7)
70
- unicode-display_width (~> 1.0, >= 1.0.1)
71
- ruby-progressbar (1.9.0)
72
- thread_safe (0.3.6)
73
- tzinfo (1.2.4)
74
- thread_safe (~> 0.1)
75
- unicode-display_width (1.3.0)
79
+ unicode-display_width (>= 1.4.0, < 2.0)
80
+ rubocop-ast (0.0.3)
81
+ parser (>= 2.7.0.1)
82
+ rubocop-performance (1.6.1)
83
+ rubocop (>= 0.71.0)
84
+ rubocop-rspec (1.40.0)
85
+ rubocop (>= 0.68.1)
86
+ ruby-progressbar (1.10.1)
87
+ ruby2_keywords (0.0.4)
88
+ tzinfo (2.0.4)
89
+ concurrent-ruby (~> 1.0)
90
+ unicode-display_width (1.7.0)
91
+ zeitwerk (2.4.2)
76
92
 
77
93
  PLATFORMS
78
94
  ruby
@@ -80,12 +96,12 @@ PLATFORMS
80
96
  DEPENDENCIES
81
97
  activerecord
82
98
  bundler
99
+ carwow_rubocop
83
100
  elasticsearch
84
101
  pry
85
102
  rake
86
103
  rspec
87
- rubocop
88
104
  zelastic!
89
105
 
90
106
  BUNDLED WITH
91
- 1.17.2
107
+ 2.1.4
@@ -17,19 +17,19 @@ module Zelastic
17
17
  @config = config
18
18
  end
19
19
 
20
- def index_batch(batch, client: nil, index_name: nil)
20
+ def index_batch(batch, client: nil, index_name: nil, refresh: false)
21
21
  version = current_version
22
- execute_bulk(client: client, index_name: index_name) do |index|
22
+ execute_bulk(client: client, index_name: index_name, refresh: refresh) do |index|
23
23
  batch.map do |record|
24
24
  index_command(index: index, version: version, record: record)
25
25
  end
26
26
  end
27
27
  end
28
28
 
29
- def index_record(record)
29
+ def index_record(record, refresh: false)
30
30
  version = current_version
31
31
 
32
- execute_bulk do |index_name|
32
+ execute_bulk(refresh: refresh) do |index_name|
33
33
  [index_command(index: index_name, version: version, record: record)]
34
34
  end
35
35
  end
@@ -91,7 +91,7 @@ module Zelastic
91
91
  }
92
92
  end
93
93
 
94
- def execute_bulk(client: nil, index_name: nil)
94
+ def execute_bulk(client: nil, index_name: nil, refresh: false)
95
95
  clients = Array(client || config.clients)
96
96
 
97
97
  clients.map do |current_client|
@@ -99,7 +99,7 @@ module Zelastic
99
99
 
100
100
  commands = indices.flat_map { |index| yield(index) }
101
101
 
102
- current_client.bulk(body: commands).tap do |result|
102
+ current_client.bulk(body: commands, refresh: refresh).tap do |result|
103
103
  check_errors!(result)
104
104
  end
105
105
  end
@@ -123,14 +123,14 @@ module Zelastic
123
123
  end
124
124
 
125
125
  def ignorable_error?(error)
126
- # rubocop:disable Metrics/LineLength
126
+ # rubocop:disable Layout/LineLength
127
127
  regexp =
128
128
  if config.type?
129
129
  /^\[#{config.type}\]\[\d+\]: version conflict, current version \[\d+\] is higher or equal to the one provided \[\d+\]$/
130
130
  else
131
131
  /^\[\d+\]: version conflict, current version \[\d+\] is higher or equal to the one provided \[\d+\]$/
132
132
  end
133
- # rubocop:enable Metrics/LineLength
133
+ # rubocop:enable Layout/LineLength
134
134
  error['type'] == 'version_conflict_engine_exception' &&
135
135
  error['reason'] =~ regexp
136
136
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zelastic
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.2'
5
5
  end
data/zelastic.gemspec CHANGED
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency 'activerecord'
28
28
  spec.add_development_dependency 'bundler'
29
+ spec.add_development_dependency 'carwow_rubocop'
29
30
  spec.add_development_dependency 'elasticsearch'
30
31
  spec.add_development_dependency 'pry'
31
32
  spec.add_development_dependency 'rake'
32
33
  spec.add_development_dependency 'rspec'
33
- spec.add_development_dependency 'rubocop'
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zelastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2021-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: elasticsearch
56
+ name: carwow_rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry
70
+ name: elasticsearch
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rake
84
+ name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rspec
98
+ name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rubocop
112
+ name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -130,6 +130,7 @@ extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
132
  - ".circleci/config.yml"
133
+ - ".github/dependabot.yml"
133
134
  - ".gitignore"
134
135
  - ".rspec"
135
136
  - ".rubocop.yml"
@@ -152,7 +153,7 @@ homepage: https://github.com/carwow/zelastic
152
153
  licenses:
153
154
  - MIT
154
155
  metadata: {}
155
- post_install_message:
156
+ post_install_message:
156
157
  rdoc_options: []
157
158
  require_paths:
158
159
  - lib
@@ -167,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  requirements: []
170
- rubygems_version: 3.0.3
171
- signing_key:
171
+ rubygems_version: 3.1.4
172
+ signing_key:
172
173
  specification_version: 4
173
174
  summary: Zero-downtime (re-)indexing of ActiveRecord models into Elasticsearch.
174
175
  test_files: []