es-elasticity 1.0.1 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +246 -202
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +79 -75
- data/README.md +1 -1
- data/es-elasticity.gemspec +8 -7
- data/lib/elasticity/index_config.rb +2 -1
- data/lib/elasticity/multi_search_response_parser.rb +1 -1
- data/lib/elasticity/strategies/alias_index.rb +5 -5
- data/lib/elasticity/strategies/single_index.rb +2 -2
- data/lib/elasticity/version.rb +1 -1
- data/lib/elasticity.rb +1 -0
- metadata +37 -18
- data/.rubocop.yml +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95636a3b634ac2079a268f7475a52d62e64eb75e9544bad28f62dc025002c28a
|
4
|
+
data.tar.gz: 9dd0729ed5b52b9aee20ab68a7b782ca226bf2c51ab1672102a00a036bfe3308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c9ad50f4ff8aeda310ffa3f1c876298252f410cdbcae586b72877381050f85b2bdf49673f830cadffd1741800bf5b78d336def51b5f6fd1efe39aa1d77d26fa
|
7
|
+
data.tar.gz: 81733102f4159be0d4c065be7515f274913f97c04a478e2d71175828d77fd1dfddbc95ac04c3a50deb090de6a40e7ae388a84033923fc20a29169254ada3b8a0
|
data/.circleci/config.yml
CHANGED
@@ -1,225 +1,269 @@
|
|
1
|
-
version: 2.1
|
1
|
+
version: '2.1'
|
2
|
+
|
3
|
+
meta:
|
4
|
+
ruby-version-matrix: &ruby-version-matrix
|
5
|
+
matrix:
|
6
|
+
parameters:
|
7
|
+
ruby-version:
|
8
|
+
- '3.1'
|
9
|
+
- '3.2'
|
10
|
+
- '3.3'
|
2
11
|
|
3
12
|
orbs:
|
4
|
-
|
13
|
+
ci-utils: doximity/ci-utils@2
|
5
14
|
|
6
15
|
executors:
|
7
|
-
|
8
|
-
|
16
|
+
ruby:
|
17
|
+
parameters:
|
18
|
+
ruby-version:
|
19
|
+
type: string
|
20
|
+
default: '3.1'
|
9
21
|
resource_class: small
|
10
22
|
docker:
|
11
|
-
- image: cimg/ruby
|
23
|
+
- image: cimg/ruby:<< parameters.ruby-version >>
|
12
24
|
environment:
|
13
|
-
BUNDLE_VERSION:
|
14
|
-
|
15
|
-
# used for testing the gem:
|
16
|
-
ruby_2_7:
|
17
|
-
resource_class: small
|
18
|
-
docker:
|
19
|
-
- image: cimg/ruby:2.7
|
25
|
+
BUNDLE_VERSION: 2.5.23
|
26
|
+
- image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
|
20
27
|
environment:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
- discovery.type=single-node
|
26
|
-
- xpack.security.enabled=false
|
27
|
-
ruby_3_0:
|
28
|
-
resource_class: small
|
29
|
-
docker:
|
30
|
-
- image: cimg/ruby:3.0
|
31
|
-
environment:
|
32
|
-
BUNDLE_VERSION: '~> 2.3.4'
|
33
|
-
- image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
|
34
|
-
environment:
|
35
|
-
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
|
36
|
-
- discovery.type=single-node
|
37
|
-
- xpack.security.enabled=false
|
28
|
+
discovery.type: single-node
|
29
|
+
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
|
30
|
+
http.port: 9200
|
31
|
+
xpack.security.enabled: false
|
38
32
|
|
39
|
-
|
40
|
-
|
41
|
-
docker:
|
42
|
-
- image: cimg/ruby:3.1
|
43
|
-
environment:
|
44
|
-
BUNDLE_VERSION: '~> 2.3.4'
|
45
|
-
- image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
|
46
|
-
environment:
|
47
|
-
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
|
48
|
-
- discovery.type=single-node
|
49
|
-
- xpack.security.enabled=false
|
50
|
-
|
51
|
-
# yaml anchor filters
|
52
|
-
master_only: &master_only
|
53
|
-
filters:
|
54
|
-
branches:
|
55
|
-
only: master
|
56
|
-
tags:
|
57
|
-
ignore: /.*/
|
58
|
-
pr_only: &pr_only
|
59
|
-
filters:
|
60
|
-
branches:
|
61
|
-
ignore: master
|
62
|
-
tags:
|
63
|
-
ignore: /.*/
|
64
|
-
version_tags_only: &version_tags_only
|
65
|
-
filters:
|
66
|
-
branches:
|
67
|
-
ignore: /.*/
|
68
|
-
tags:
|
69
|
-
only: /^v.*/
|
70
|
-
|
71
|
-
jobs:
|
72
|
-
build_2_7:
|
73
|
-
executor: ruby_2_7
|
33
|
+
commands:
|
34
|
+
bundle_install:
|
74
35
|
steps:
|
75
|
-
- checkout
|
76
36
|
- run:
|
77
37
|
name: Install Bundler specific version
|
78
|
-
command:
|
79
|
-
gem install bundler --version "${BUNDLE_VERSION}" --force
|
80
|
-
- restore_cache:
|
81
|
-
keys:
|
82
|
-
- v3-bundle-ruby_2_7-{{ checksum "Gemfile.lock" }}
|
83
|
-
- run:
|
84
|
-
name: Install Ruby Dependencies
|
85
|
-
command: bundle check --path=vendor/bundle || bundle install --local --frozen --path=vendor/bundle --jobs=4 --retry=3
|
86
|
-
- save_cache:
|
87
|
-
key: v3-bundle-ruby_2_7-{{ checksum "Gemfile.lock" }}
|
88
|
-
paths:
|
89
|
-
- vendor/bundle
|
90
|
-
- run:
|
91
|
-
name: Wait for ElasticSearch
|
92
|
-
command: dockerize -wait http://127.0.0.1:9200 -timeout 1m
|
38
|
+
command: gem install bundler --version "$BUNDLE_VERSION" --force
|
93
39
|
- run:
|
94
|
-
name:
|
95
|
-
command: bundle exec rspec
|
96
|
-
- persist_to_workspace:
|
97
|
-
root: .
|
98
|
-
paths:
|
99
|
-
- vendor/bundle
|
100
|
-
build_3_0:
|
101
|
-
executor: ruby_3_0
|
102
|
-
steps:
|
103
|
-
- checkout
|
104
|
-
- run:
|
105
|
-
name: Install Bundler specific version
|
40
|
+
name: Configure Bundler
|
106
41
|
command: |
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
42
|
+
bundle config set --local cache_path 'vendor/cache'
|
43
|
+
bundle config set --local path 'vendor/bundle'
|
44
|
+
bundle config set --local jobs 4
|
45
|
+
bundle config set --local retry 3
|
46
|
+
bundle config set --local timeout 60
|
47
|
+
if [ -f "Gemfile.lock" ]; then
|
48
|
+
bundle config set --local frozen true
|
49
|
+
fi
|
111
50
|
- run:
|
112
|
-
name:
|
113
|
-
command: bundle
|
114
|
-
- save_cache:
|
115
|
-
key: v3-bundle-ruby_3_0-{{ checksum "Gemfile.lock" }}
|
116
|
-
paths:
|
117
|
-
- vendor/bundle
|
118
|
-
- run:
|
119
|
-
name: Wait for ElasticSearch
|
120
|
-
command: dockerize -wait http://127.0.0.1:9200 -timeout 1m
|
51
|
+
name: Log bundle config
|
52
|
+
command: bundle config
|
121
53
|
- run:
|
122
|
-
name:
|
123
|
-
command:
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
54
|
+
name: Install Ruby Dependencies
|
55
|
+
command: |
|
56
|
+
if [ -d "vendor/cache" ]; then
|
57
|
+
bundle install --local --verbose
|
58
|
+
else
|
59
|
+
bundle install --verbose
|
60
|
+
fi
|
61
|
+
|
62
|
+
run_rspec_tests:
|
63
|
+
parameters:
|
64
|
+
test_pattern:
|
65
|
+
default: "{$(ls -d spec/**/ | tr '\\n' ',' | sed -E 's/(spec\\/|factories|support|\\/|,$)//g' | sed 's/,\\{2,\\}/,/g')}"
|
66
|
+
type: string
|
67
|
+
test_files:
|
68
|
+
default: $(circleci tests glob "spec/$TEST_PATTERN/**/*_spec.rb" | circleci tests split --split-by=timings)
|
69
|
+
type: string
|
70
|
+
profile-specs:
|
71
|
+
type: integer
|
72
|
+
default: 0
|
131
73
|
steps:
|
132
|
-
- checkout
|
133
74
|
- run:
|
134
|
-
name:
|
75
|
+
name: Run RSpec Tests
|
76
|
+
environment:
|
77
|
+
OUT_PATH: tmp/test-results
|
78
|
+
PROFILE_COUNT: "<< parameters.profile-specs >>"
|
135
79
|
command: |
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
80
|
+
shopt -s globstar
|
81
|
+
mkdir -p $OUT_PATH
|
82
|
+
TEST_PATTERN=<< parameters.test_pattern >>
|
83
|
+
TEST_FILES=<< parameters.test_files >>
|
84
|
+
RSPEC_COMMAND="bundle exec rspec --profile $PROFILE_COUNT --format RspecJunitFormatter --out $OUT_PATH/results.xml --format progress --order defined $TEST_FILES"
|
85
|
+
printf "Executing specs with the following command:\n\n"
|
86
|
+
echo ${RSPEC_COMMAND}
|
87
|
+
printf "\n"
|
88
|
+
${RSPEC_COMMAND}
|
89
|
+
echo "RSpec exited with code $?"
|
140
90
|
- run:
|
141
|
-
name:
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
91
|
+
name: Double check RSpec Failures
|
92
|
+
environment:
|
93
|
+
OUT_PATH: tmp/test-results
|
94
|
+
command: |
|
95
|
+
FILE=$OUT_PATH/results.xml
|
96
|
+
if [ -f $FILE ]; then
|
97
|
+
FAIL_COUNT=$(ruby -r rexml/document -e 'include REXML; puts XPath.first(Document.new($stdin), "string(//testsuite/@failures)")' < $FILE )
|
98
|
+
if [ $FAIL_COUNT -gt 0 ]; then
|
99
|
+
printf "IF YOU ARE READING THIS, TESTS FAILED BUT \"rspec\" RETURNED A 0 EXIT CODE AND LOOKS GREEN!\n\n"
|
100
|
+
printf "PLEASE LOOK AT THE PREVIOUS STEP TITLED \"Run RSpec Tests\" TO SEE SPEC FAILURE INFO!\n\n"
|
101
|
+
printf "You may also look at the \"TESTS\" tab, which will show failing spec info.\n\n"
|
102
|
+
printf "Additionally, $FILE is available for download and inspection in the \"ARTIFACTS\" tab.\n\n"
|
103
|
+
exit 1
|
104
|
+
fi
|
105
|
+
else
|
106
|
+
echo "$FILE not found..."
|
107
|
+
exit 0
|
108
|
+
fi
|
109
|
+
echo "No uncaught RSpec failures detected!"
|
110
|
+
|
111
|
+
install_gem_version:
|
112
|
+
parameters:
|
113
|
+
gem-version:
|
114
|
+
description: |
|
115
|
+
The name and version number (e.g. rails-7.0.3) you want installed, specified to the patch version.
|
116
|
+
type: string
|
117
|
+
default: ''
|
118
|
+
steps:
|
119
|
+
- when:
|
120
|
+
condition: "<< parameters.gem-version >>"
|
121
|
+
steps:
|
122
|
+
- run:
|
123
|
+
name: Unfreeze Bundle
|
124
|
+
command: bundle config set --local frozen 'false'
|
125
|
+
- run:
|
126
|
+
name: Show prior gem version
|
127
|
+
command: |
|
128
|
+
read -r target_gemname target_version \<<< $( echo "<< parameters.gem-version >>" | sed 's/\(.*\)-\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)*\)/\1 \2/g')
|
129
|
+
version=$(bundle list | sed -n "s/[[:space:]]*\* $target_gemname (\(.*\))/\1/p")
|
130
|
+
if [[ -z "$version" ]]; then
|
131
|
+
echo "No prior version of ${target_gemname} found."
|
132
|
+
else
|
133
|
+
echo $version;
|
134
|
+
fi
|
135
|
+
- run:
|
136
|
+
name: Set gem version to << parameters.gem-version >>
|
137
|
+
command: |
|
138
|
+
cd
|
139
|
+
read -r target_gemname target_version \<<< $( echo "<< parameters.gem-version >>" | sed 's/\(.*\)-\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)*\)/\1 \2/g')
|
140
|
+
gem install $target_gemname -i /tmp/repo --no-document -v $target_version
|
141
|
+
|
142
|
+
echo 'Delete any gems matching the newly installed ones from the existing cache'
|
143
|
+
for line in $(ls /tmp/repo/cache | grep gem); do
|
144
|
+
read -r gemname version \<<< $( echo $line | sed 's/\(.*\)-\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)*\)[^0-9\.]*.*.gem/\1 \2/g')
|
145
|
+
if [ $gemname = 'bundler' ]; # skip bundler
|
146
|
+
then continue
|
147
|
+
fi
|
148
|
+
rm -f ~/project/vendor/cache/$gemname*.gem
|
149
|
+
done;
|
150
|
+
|
151
|
+
echo 'The following gems will be copied into the project: '
|
152
|
+
ls -l /tmp/repo/cache
|
153
|
+
cp /tmp/repo/cache/*.gem ~/project/vendor/cache
|
154
|
+
|
155
|
+
echo 'Showing gems in the project cache: ls -al ~/project/vendor/cache'
|
156
|
+
ls -al ~/project/vendor/cache
|
157
|
+
|
158
|
+
cd ~/project
|
159
|
+
echo 'Removing Gemfile.lock'
|
160
|
+
rm -f ./Gemfile.lock
|
161
|
+
|
162
|
+
echo 'Fancy replacement. Set all gems in the gemspec to what we currently have in the vendor/cache.'
|
163
|
+
for line in $(ls vendor/cache | grep gem); do
|
164
|
+
# we don't care about the .gem, get rid of it
|
165
|
+
trimmed_line=${line%%.gem}
|
166
|
+
# version to include anything after the gem name so we can pick up prerelease versions
|
167
|
+
read -r gemname version \<<< $( echo $trimmed_line | sed 's/\(.*\)-\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)*[^0-9\.]*.*\)/\1 \2/g' )
|
168
|
+
|
169
|
+
# leave bundler alone
|
170
|
+
if [ $gemname = 'bundler' ];
|
171
|
+
then continue
|
172
|
+
fi
|
173
|
+
|
174
|
+
# strip out platform info from version, we just want the number plus any prerelease identifiers
|
175
|
+
version=$(echo $version | cut -d "-" -f 1)
|
176
|
+
|
177
|
+
sed -i "s/\(.*_dependency \"$gemname\"\)".*"/\1, \"~> $version\"/g" *.gemspec
|
178
|
+
|
179
|
+
if [[ "$gemname" = "$target_gemname" ]]; then
|
180
|
+
if [[ -z "$(sed -n "s/\(.*_dependency \"$gemname\"\).*\"/\1/p" *.gemspec)" ]];
|
181
|
+
then
|
182
|
+
echo 'No pre-existing version, adding version';
|
183
|
+
replacement="spec\\.add_development_dependency \"$gemname\", \"~> $version\""
|
184
|
+
sed -e "0,/add.*dependency/{/add.*dependency/a\ $replacement" -e "}" -i -- *.gemspec
|
185
|
+
else
|
186
|
+
echo 'nothing to do';
|
187
|
+
fi;
|
188
|
+
fi;
|
189
|
+
done;
|
190
|
+
|
191
|
+
echo 'cat *.gemspec'
|
192
|
+
cat *.gemspec
|
193
|
+
|
194
|
+
echo 'bundle install --local --no-cache'
|
195
|
+
bundle install --local --no-cache
|
196
|
+
- run:
|
197
|
+
name: Gem version after upgrade
|
198
|
+
command: |
|
199
|
+
read -r target_gemname target_version \<<< $( echo "<< parameters.gem-version >>" | sed 's/\(.*\)-\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)*\)/\1 \2/g')
|
200
|
+
version=$(bundle list | sed -n "s/[[:space:]]*\* $target_gemname (\(.*\))/\1/p")
|
201
|
+
if [[ -z "$version" ]]; then
|
202
|
+
echo "${target_gemname} was somehow not installed."
|
203
|
+
exit 1
|
204
|
+
else
|
205
|
+
echo $version;
|
206
|
+
fi
|
207
|
+
|
208
|
+
jobs:
|
209
|
+
run_tests_ruby:
|
210
|
+
parameters:
|
211
|
+
executor:
|
212
|
+
type: string
|
213
|
+
default: ruby
|
214
|
+
parallelism:
|
215
|
+
type: integer
|
216
|
+
default: 1
|
217
|
+
resource_class:
|
218
|
+
type: string
|
219
|
+
default: small
|
220
|
+
gem-version:
|
221
|
+
description: |
|
222
|
+
The name and version number (e.g. rails-7.0.3) you want installed, specified to the patch version.
|
223
|
+
type: string
|
224
|
+
default: ''
|
225
|
+
ruby-version:
|
226
|
+
type: string
|
227
|
+
default: '3.1'
|
228
|
+
pre-actions:
|
229
|
+
description: Steps to perform any necessary setup after dependencies are installed.
|
230
|
+
type: steps
|
231
|
+
default:
|
232
|
+
- run:
|
233
|
+
name: Wait for ElasticSearch
|
234
|
+
command: dockerize -wait http://127.0.0.1:9200 -timeout 1m
|
235
|
+
actions:
|
236
|
+
description: The actions that fulfill the primary purpose of the CI job (tests/checks/etc.)
|
237
|
+
type: steps
|
238
|
+
default:
|
239
|
+
- run_rspec_tests
|
240
|
+
post-actions:
|
241
|
+
description: Any artifacting/reporting/cleanup that must occur after the main
|
242
|
+
actions.
|
243
|
+
type: steps
|
244
|
+
default:
|
245
|
+
- store_test_results:
|
246
|
+
path: tmp/test-results
|
247
|
+
executor:
|
248
|
+
name: "<< parameters.executor >>"
|
249
|
+
ruby-version: "<< parameters.ruby-version >>"
|
250
|
+
resource_class: "<< parameters.resource_class >>"
|
251
|
+
parallelism: "<< parameters.parallelism >>"
|
252
|
+
steps:
|
253
|
+
- ci-utils/ci_checkout
|
254
|
+
- bundle_install
|
255
|
+
- install_gem_version:
|
256
|
+
gem-version: "<< parameters.gem-version >>"
|
257
|
+
- steps: "<< parameters.pre-actions >>"
|
258
|
+
- steps: "<< parameters.actions >>"
|
259
|
+
- steps: "<< parameters.post-actions >>"
|
260
|
+
- ci-utils/quietly_store_artifacts
|
157
261
|
|
158
262
|
workflows:
|
159
|
-
|
160
|
-
trunk:
|
161
|
-
jobs:
|
162
|
-
- build_2_7:
|
163
|
-
<<: *master_only
|
164
|
-
- build_3_0:
|
165
|
-
<<: *master_only
|
166
|
-
- build_3_1:
|
167
|
-
<<: *master_only
|
168
|
-
- gem/build:
|
169
|
-
<<: *master_only
|
170
|
-
executor: ruby-latest
|
171
|
-
name: gem-build
|
172
|
-
requires:
|
173
|
-
- build_3_1
|
174
|
-
|
175
|
-
pull-requests:
|
176
|
-
jobs:
|
177
|
-
- build_2_7:
|
178
|
-
<<: *pr_only
|
179
|
-
- build_3_0:
|
180
|
-
<<: *pr_only
|
181
|
-
- build_3_1:
|
182
|
-
<<: *pr_only
|
183
|
-
- gem/build:
|
184
|
-
<<: *pr_only
|
185
|
-
executor: ruby-latest
|
186
|
-
name: gem-build
|
187
|
-
requires:
|
188
|
-
- build_3_1
|
189
|
-
- pre-release-approval:
|
190
|
-
<<: *pr_only
|
191
|
-
type: approval
|
192
|
-
requires:
|
193
|
-
- gem-build
|
194
|
-
- gem/publish:
|
195
|
-
<<: *pr_only
|
196
|
-
name: gem-publish
|
197
|
-
to_rubygems: false
|
198
|
-
to_nexus: true
|
199
|
-
pre_release: true
|
200
|
-
requires:
|
201
|
-
- pre-release-approval
|
202
|
-
context: artifact_publishing
|
203
|
-
|
204
|
-
final-release:
|
263
|
+
main:
|
205
264
|
jobs:
|
206
|
-
-
|
207
|
-
|
208
|
-
|
209
|
-
<<: *
|
210
|
-
|
211
|
-
<<: *version_tags_only
|
212
|
-
- gem/build:
|
213
|
-
<<: *version_tags_only
|
214
|
-
executor: ruby-latest
|
215
|
-
name: gem-build
|
216
|
-
requires:
|
217
|
-
- build_3_1
|
218
|
-
- gem/publish:
|
219
|
-
<<: *version_tags_only
|
220
|
-
name: gem-publish
|
221
|
-
to_rubygems: true
|
222
|
-
pre_release: false
|
223
|
-
requires:
|
224
|
-
- gem-build
|
225
|
-
context: artifact_publishing
|
265
|
+
- run_tests_ruby:
|
266
|
+
executor: ruby
|
267
|
+
context: nexus_readonly
|
268
|
+
<<: *ruby-version-matrix
|
269
|
+
name: run_tests_ruby-ruby-<< matrix.ruby-version >>
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [1.2.1] - 2024-12-03
|
8
|
+
### Changed
|
9
|
+
- Compatibility with Rails 7.2 and beyond
|
10
|
+
|
11
|
+
## [1.1.0] - 2023-05-02
|
12
|
+
### Changed
|
13
|
+
- Updated the max elasticsearch dependency version to < 8.7
|
8
14
|
|
9
15
|
## [1.0.1] - 2022-08-16
|
10
16
|
### Changed
|
data/Gemfile.lock
CHANGED
@@ -1,102 +1,106 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
es-elasticity (1.
|
5
|
-
activemodel (>= 5.2.0, <
|
6
|
-
activerecord (>= 5.2.0, <
|
7
|
-
activesupport (>= 5.2.0, <
|
8
|
-
|
4
|
+
es-elasticity (1.2.1)
|
5
|
+
activemodel (>= 5.2.0, < 8)
|
6
|
+
activerecord (>= 5.2.0, < 8)
|
7
|
+
activesupport (>= 5.2.0, < 8)
|
8
|
+
elastic-transport (>= 8.0, < 8.7)
|
9
|
+
elasticsearch (>= 7, < 8.7)
|
9
10
|
|
10
11
|
GEM
|
11
12
|
remote: https://artifacts.dox.support/repository/gems/
|
12
13
|
specs:
|
13
|
-
activemodel (7.
|
14
|
-
activesupport (= 7.
|
15
|
-
activerecord (7.
|
16
|
-
activemodel (= 7.
|
17
|
-
activesupport (= 7.
|
18
|
-
|
19
|
-
|
14
|
+
activemodel (7.2.2)
|
15
|
+
activesupport (= 7.2.2)
|
16
|
+
activerecord (7.2.2)
|
17
|
+
activemodel (= 7.2.2)
|
18
|
+
activesupport (= 7.2.2)
|
19
|
+
timeout (>= 0.4.0)
|
20
|
+
activesupport (7.2.2)
|
21
|
+
base64
|
22
|
+
benchmark (>= 0.3)
|
23
|
+
bigdecimal
|
24
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
25
|
+
connection_pool (>= 2.2.5)
|
26
|
+
drb
|
20
27
|
i18n (>= 1.6, < 2)
|
28
|
+
logger (>= 1.4.2)
|
21
29
|
minitest (>= 5.1)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
securerandom (>= 0.3)
|
31
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
32
|
+
base64 (0.2.0)
|
33
|
+
benchmark (0.4.0)
|
34
|
+
bigdecimal (3.1.8)
|
35
|
+
byebug (11.1.3)
|
36
|
+
codeclimate-test-reporter (1.0.7)
|
37
|
+
simplecov
|
38
|
+
coderay (1.1.3)
|
39
|
+
concurrent-ruby (1.3.4)
|
40
|
+
connection_pool (2.4.1)
|
41
|
+
diff-lcs (1.5.1)
|
42
|
+
docile (1.4.1)
|
43
|
+
drb (2.2.1)
|
44
|
+
elastic-transport (8.2.1)
|
45
|
+
faraday (< 3)
|
33
46
|
multi_json
|
34
|
-
elasticsearch
|
35
|
-
|
47
|
+
elasticsearch (8.6.0)
|
48
|
+
elastic-transport (~> 8)
|
49
|
+
elasticsearch-api (= 8.6.0)
|
50
|
+
elasticsearch-api (8.6.0)
|
36
51
|
multi_json
|
37
|
-
faraday (
|
38
|
-
faraday-
|
39
|
-
faraday-em_synchrony (~> 1.0)
|
40
|
-
faraday-excon (~> 1.1)
|
41
|
-
faraday-httpclient (~> 1.0)
|
42
|
-
faraday-multipart (~> 1.0)
|
43
|
-
faraday-net_http (~> 1.0)
|
44
|
-
faraday-net_http_persistent (~> 1.0)
|
45
|
-
faraday-patron (~> 1.0)
|
46
|
-
faraday-rack (~> 1.0)
|
47
|
-
faraday-retry (~> 1.0)
|
52
|
+
faraday (2.7.4)
|
53
|
+
faraday-net_http (>= 2.0, < 3.1)
|
48
54
|
ruby2_keywords (>= 0.0.4)
|
49
|
-
faraday-
|
50
|
-
|
51
|
-
faraday-excon (1.1.0)
|
52
|
-
faraday-httpclient (1.0.1)
|
53
|
-
faraday-multipart (1.0.4)
|
54
|
-
multipart-post (~> 2)
|
55
|
-
faraday-net_http (1.0.1)
|
56
|
-
faraday-net_http_persistent (1.2.0)
|
57
|
-
faraday-patron (1.0.0)
|
58
|
-
faraday-rack (1.0.0)
|
59
|
-
faraday-retry (1.0.3)
|
60
|
-
i18n (1.12.0)
|
55
|
+
faraday-net_http (3.0.2)
|
56
|
+
i18n (1.14.6)
|
61
57
|
concurrent-ruby (~> 1.0)
|
62
|
-
|
63
|
-
|
58
|
+
logger (1.6.1)
|
59
|
+
method_source (1.1.0)
|
60
|
+
minitest (5.25.1)
|
64
61
|
multi_json (1.15.0)
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
62
|
+
oj (3.16.7)
|
63
|
+
bigdecimal (>= 3.0)
|
64
|
+
ostruct (>= 0.2)
|
65
|
+
ostruct (0.6.0)
|
66
|
+
pry (0.14.2)
|
67
|
+
coderay (~> 1.1)
|
68
|
+
method_source (~> 1.0)
|
70
69
|
rake (10.5.0)
|
71
70
|
redis (4.1.3)
|
72
|
-
rspec (3.
|
73
|
-
rspec-core (~> 3.
|
74
|
-
rspec-expectations (~> 3.
|
75
|
-
rspec-mocks (~> 3.
|
76
|
-
rspec-core (3.
|
77
|
-
rspec-support (~> 3.
|
78
|
-
rspec-expectations (3.
|
71
|
+
rspec (3.13.0)
|
72
|
+
rspec-core (~> 3.13.0)
|
73
|
+
rspec-expectations (~> 3.13.0)
|
74
|
+
rspec-mocks (~> 3.13.0)
|
75
|
+
rspec-core (3.13.2)
|
76
|
+
rspec-support (~> 3.13.0)
|
77
|
+
rspec-expectations (3.13.3)
|
79
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
-
rspec-support (~> 3.
|
81
|
-
rspec-mocks (3.
|
82
|
-
|
83
|
-
|
79
|
+
rspec-support (~> 3.13.0)
|
80
|
+
rspec-mocks (3.13.2)
|
81
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
+
rspec-support (~> 3.13.0)
|
83
|
+
rspec-support (3.13.1)
|
84
84
|
rspec_junit_formatter (0.4.1)
|
85
85
|
rspec-core (>= 2, < 4, != 2.12.0)
|
86
86
|
ruby2_keywords (0.0.5)
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
securerandom (0.3.1)
|
88
|
+
simplecov (0.22.0)
|
89
|
+
docile (~> 1.1)
|
90
|
+
simplecov-html (~> 0.11)
|
91
|
+
simplecov_json_formatter (~> 0.1)
|
92
|
+
simplecov-html (0.13.1)
|
93
|
+
simplecov_json_formatter (0.1.4)
|
91
94
|
timecop (0.9.5)
|
92
|
-
|
95
|
+
timeout (0.4.2)
|
96
|
+
tzinfo (2.0.6)
|
93
97
|
concurrent-ruby (~> 1.0)
|
94
98
|
|
95
99
|
PLATFORMS
|
96
100
|
ruby
|
97
101
|
|
98
102
|
DEPENDENCIES
|
99
|
-
bundler (~> 2.
|
103
|
+
bundler (~> 2.5)
|
100
104
|
byebug
|
101
105
|
codeclimate-test-reporter
|
102
106
|
es-elasticity!
|
@@ -104,10 +108,10 @@ DEPENDENCIES
|
|
104
108
|
pry
|
105
109
|
rake (~> 10.0)
|
106
110
|
redis
|
107
|
-
rspec (~> 3.
|
111
|
+
rspec (~> 3.13.0)
|
108
112
|
rspec_junit_formatter
|
109
|
-
simplecov (~> 0.
|
113
|
+
simplecov (~> 0.22.0)
|
110
114
|
timecop
|
111
115
|
|
112
116
|
BUNDLED WITH
|
113
|
-
2.
|
117
|
+
2.5.23
|
data/README.md
CHANGED
data/es-elasticity.gemspec
CHANGED
@@ -21,20 +21,21 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", "~> 2.
|
24
|
+
spec.add_development_dependency "bundler", "~> 2.5"
|
25
25
|
spec.add_development_dependency "byebug"
|
26
26
|
spec.add_development_dependency "codeclimate-test-reporter"
|
27
27
|
spec.add_development_dependency "oj"
|
28
28
|
spec.add_development_dependency "pry"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
30
30
|
spec.add_development_dependency "redis"
|
31
|
-
spec.add_development_dependency "rspec", "~> 3.
|
31
|
+
spec.add_development_dependency "rspec", "~> 3.13.0"
|
32
32
|
spec.add_development_dependency "rspec_junit_formatter"
|
33
|
-
spec.add_development_dependency "simplecov", "~> 0.
|
33
|
+
spec.add_development_dependency "simplecov", "~> 0.22.0"
|
34
34
|
spec.add_development_dependency "timecop"
|
35
35
|
|
36
|
-
spec.add_dependency "activemodel", ">= 5.2.0", "<
|
37
|
-
spec.add_dependency "activerecord", ">= 5.2.0", "<
|
38
|
-
spec.add_dependency "activesupport", ">= 5.2.0", "<
|
39
|
-
spec.add_dependency "elasticsearch", ">= 7", "< 8"
|
36
|
+
spec.add_dependency "activemodel", ">= 5.2.0", "< 8"
|
37
|
+
spec.add_dependency "activerecord", ">= 5.2.0", "< 8"
|
38
|
+
spec.add_dependency "activesupport", ">= 5.2.0", "< 8"
|
39
|
+
spec.add_dependency "elasticsearch", ">= 7", "< 8.7"
|
40
|
+
spec.add_dependency "elastic-transport", ">= 8.0", "< 8.7"
|
40
41
|
end
|
@@ -84,8 +84,9 @@ module Elasticity
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def warn_deprecated_config
|
87
|
+
deprecation = ActiveSupport::Deprecation.new("next major release", "es-elasticity")
|
87
88
|
DEPRECATED_ATTRS.each do |attr|
|
88
|
-
|
89
|
+
deprecation.warn(
|
89
90
|
"#{attr} is deprecated and will be "\
|
90
91
|
"removed in the next major release."
|
91
92
|
) if public_send(attr).present?
|
@@ -108,7 +108,7 @@ module Elasticity
|
|
108
108
|
waiting_duration = 0
|
109
109
|
begin
|
110
110
|
@client.index_delete(index: original_index)
|
111
|
-
rescue
|
111
|
+
rescue Elastic::Transport::Transport::ServerError => e
|
112
112
|
if retryable_error?(e) && retry_delete_on_recoverable_errors && waiting_duration < max_delay
|
113
113
|
waiting_duration += retry_delay
|
114
114
|
sleep(retry_delay)
|
@@ -174,13 +174,13 @@ module Elasticity
|
|
174
174
|
|
175
175
|
def main_indexes
|
176
176
|
@client.index_get_alias(index: "#{@main_alias}-*", name: @main_alias).keys
|
177
|
-
rescue
|
177
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
178
178
|
[]
|
179
179
|
end
|
180
180
|
|
181
181
|
def update_indexes
|
182
182
|
@client.index_get_alias(index: "#{@main_alias}-*", name: @update_alias).keys
|
183
|
-
rescue
|
183
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
184
184
|
[]
|
185
185
|
end
|
186
186
|
|
@@ -264,7 +264,7 @@ module Elasticity
|
|
264
264
|
|
265
265
|
def settings
|
266
266
|
@client.index_get_settings(index: @main_alias).values.first
|
267
|
-
rescue
|
267
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
268
268
|
nil
|
269
269
|
end
|
270
270
|
|
@@ -278,7 +278,7 @@ module Elasticity
|
|
278
278
|
|
279
279
|
def mapping
|
280
280
|
@client.index_get_mapping(index: @main_alias).values.first
|
281
|
-
rescue
|
281
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
282
282
|
nil
|
283
283
|
end
|
284
284
|
|
@@ -80,7 +80,7 @@ module Elasticity
|
|
80
80
|
|
81
81
|
def settings
|
82
82
|
@client.index_get_settings(index: @index_name).values.first
|
83
|
-
rescue
|
83
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
84
84
|
nil
|
85
85
|
end
|
86
86
|
|
@@ -94,7 +94,7 @@ module Elasticity
|
|
94
94
|
|
95
95
|
def mapping
|
96
96
|
@client.index_get_mapping(index: @index_name).values.first
|
97
|
-
rescue
|
97
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
98
98
|
nil
|
99
99
|
end
|
100
100
|
|
data/lib/elasticity/version.rb
CHANGED
data/lib/elasticity.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: es-elasticity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Kochenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.
|
117
|
+
version: 3.13.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 3.
|
124
|
+
version: 3.13.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec_junit_formatter
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.22.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.22.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: timecop
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,7 +173,7 @@ dependencies:
|
|
173
173
|
version: 5.2.0
|
174
174
|
- - "<"
|
175
175
|
- !ruby/object:Gem::Version
|
176
|
-
version: '
|
176
|
+
version: '8'
|
177
177
|
type: :runtime
|
178
178
|
prerelease: false
|
179
179
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -183,7 +183,7 @@ dependencies:
|
|
183
183
|
version: 5.2.0
|
184
184
|
- - "<"
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: '
|
186
|
+
version: '8'
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
188
|
name: activerecord
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,7 +193,7 @@ dependencies:
|
|
193
193
|
version: 5.2.0
|
194
194
|
- - "<"
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version: '
|
196
|
+
version: '8'
|
197
197
|
type: :runtime
|
198
198
|
prerelease: false
|
199
199
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -203,7 +203,7 @@ dependencies:
|
|
203
203
|
version: 5.2.0
|
204
204
|
- - "<"
|
205
205
|
- !ruby/object:Gem::Version
|
206
|
-
version: '
|
206
|
+
version: '8'
|
207
207
|
- !ruby/object:Gem::Dependency
|
208
208
|
name: activesupport
|
209
209
|
requirement: !ruby/object:Gem::Requirement
|
@@ -213,7 +213,7 @@ dependencies:
|
|
213
213
|
version: 5.2.0
|
214
214
|
- - "<"
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version: '
|
216
|
+
version: '8'
|
217
217
|
type: :runtime
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -223,7 +223,7 @@ dependencies:
|
|
223
223
|
version: 5.2.0
|
224
224
|
- - "<"
|
225
225
|
- !ruby/object:Gem::Version
|
226
|
-
version: '
|
226
|
+
version: '8'
|
227
227
|
- !ruby/object:Gem::Dependency
|
228
228
|
name: elasticsearch
|
229
229
|
requirement: !ruby/object:Gem::Requirement
|
@@ -233,7 +233,7 @@ dependencies:
|
|
233
233
|
version: '7'
|
234
234
|
- - "<"
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: '8'
|
236
|
+
version: '8.7'
|
237
237
|
type: :runtime
|
238
238
|
prerelease: false
|
239
239
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -243,7 +243,27 @@ dependencies:
|
|
243
243
|
version: '7'
|
244
244
|
- - "<"
|
245
245
|
- !ruby/object:Gem::Version
|
246
|
-
version: '8'
|
246
|
+
version: '8.7'
|
247
|
+
- !ruby/object:Gem::Dependency
|
248
|
+
name: elastic-transport
|
249
|
+
requirement: !ruby/object:Gem::Requirement
|
250
|
+
requirements:
|
251
|
+
- - ">="
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: '8.0'
|
254
|
+
- - "<"
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: '8.7'
|
257
|
+
type: :runtime
|
258
|
+
prerelease: false
|
259
|
+
version_requirements: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: '8.0'
|
264
|
+
- - "<"
|
265
|
+
- !ruby/object:Gem::Version
|
266
|
+
version: '8.7'
|
247
267
|
description: Elasticity provides a higher level abstraction on top of [elasticsearch-ruby](https://github.com/elasticsearch/elasticsearch-ruby)
|
248
268
|
gem
|
249
269
|
email:
|
@@ -255,7 +275,6 @@ files:
|
|
255
275
|
- ".circleci/config.yml"
|
256
276
|
- ".gitignore"
|
257
277
|
- ".rspec"
|
258
|
-
- ".rubocop.yml"
|
259
278
|
- ".simplecov"
|
260
279
|
- CHANGELOG.md
|
261
280
|
- CONTRIBUTING.md
|
@@ -304,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
323
|
- !ruby/object:Gem::Version
|
305
324
|
version: '0'
|
306
325
|
requirements: []
|
307
|
-
rubygems_version: 3.3.
|
326
|
+
rubygems_version: 3.0.3.1
|
308
327
|
signing_key:
|
309
328
|
specification_version: 4
|
310
329
|
summary: ActiveModel-based library for working with Elasticsearch
|
data/.rubocop.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
---
|
2
|
-
inherit_gem:
|
3
|
-
dox-style:
|
4
|
-
- ".rubocop.yml"
|
5
|
-
|
6
|
-
Env/UseFetch:
|
7
|
-
Exclude:
|
8
|
-
- "./bin/*"
|
9
|
-
|
10
|
-
Metrics/BlockLength:
|
11
|
-
Exclude:
|
12
|
-
- "./**/*_spec*.rb"
|
13
|
-
- "./*.gemspec"
|
14
|
-
- "./spec/*_helper*.rb"
|
15
|
-
- "Gemfile"
|
16
|
-
|
17
|
-
Metrics/ModuleLength:
|
18
|
-
Exclude:
|
19
|
-
- "./**/*_spec*.rb"
|
20
|
-
|
21
|
-
Metrics/MethodLength:
|
22
|
-
Exclude:
|
23
|
-
- "./**/*_spec*.rb"
|