algolia 2.0.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_helper.rb CHANGED
@@ -28,6 +28,22 @@ class Minitest::Test
28
28
  @@search_client = Algolia::Search::Client.new(@@search_config)
29
29
  end
30
30
 
31
+ def assert_requests(requester, requests)
32
+ refute_empty requests
33
+ refute_nil requester
34
+
35
+ actual_requests = requester.requests
36
+ assert_equal requests.size, actual_requests.size
37
+
38
+ requests.each_with_index do |expected_request, i|
39
+ request = actual_requests[i]
40
+
41
+ assert_equal(expected_request[:body], request[:body])
42
+ assert_equal(expected_request[:method], request[:method])
43
+ assert_equal(expected_request[:path], request[:path])
44
+ end
45
+ end
46
+
31
47
  def check_environment_variables
32
48
  raise Algolia::AlgoliaError, 'ALGOLIA_APPLICATION_ID_1 must be defined' if ENV['ALGOLIA_APPLICATION_ID_1'].to_s.strip.empty?
33
49
  raise Algolia::AlgoliaError, 'ALGOLIA_ADMIN_KEY_1 must be defined' if ENV['ALGOLIA_ADMIN_KEY_1'].to_s.strip.empty?
@@ -87,3 +103,15 @@ def rule_without_metadata(rule)
87
103
  rule.delete(:_metadata)
88
104
  rule
89
105
  end
106
+
107
+ def retry_test(delay = 0.1, max_retries = 30)
108
+ (1...max_retries).each do |i|
109
+ begin
110
+ return yield
111
+ rescue Algolia::AlgoliaHttpError
112
+ sleep delay * i
113
+ end
114
+ end
115
+
116
+ raise StandardError, 'reached the maximum number of retries'
117
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-09 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,6 +192,7 @@ extensions: []
192
192
  extra_rdoc_files: []
193
193
  files:
194
194
  - ".circleci/config.yml"
195
+ - ".dockerignore"
195
196
  - ".github/ISSUE_TEMPLATE.md"
196
197
  - ".github/PULL_REQUEST_TEMPLATE.md"
197
198
  - ".gitignore"
@@ -199,6 +200,9 @@ files:
199
200
  - ".rubocop_todo.yml"
200
201
  - CHANGELOG.md
201
202
  - CODE_OF_CONDUCT.md
203
+ - CONTRIBUTING.MD
204
+ - DOCKER_README.MD
205
+ - Dockerfile
202
206
  - Gemfile
203
207
  - LICENSE
204
208
  - README.md
@@ -214,6 +218,7 @@ files:
214
218
  - lib/algolia/config/analytics_config.rb
215
219
  - lib/algolia/config/base_config.rb
216
220
  - lib/algolia/config/insights_config.rb
221
+ - lib/algolia/config/recommend_config.rb
217
222
  - lib/algolia/config/recommendation_config.rb
218
223
  - lib/algolia/config/search_config.rb
219
224
  - lib/algolia/defaults.rb
@@ -230,10 +235,12 @@ files:
230
235
  - lib/algolia/iterators/rule_iterator.rb
231
236
  - lib/algolia/iterators/synonym_iterator.rb
232
237
  - lib/algolia/logger_helper.rb
238
+ - lib/algolia/recommend_client.rb
233
239
  - lib/algolia/recommendation_client.rb
234
240
  - lib/algolia/responses/add_api_key_response.rb
235
241
  - lib/algolia/responses/base_response.rb
236
242
  - lib/algolia/responses/delete_api_key_response.rb
243
+ - lib/algolia/responses/dictionary_response.rb
237
244
  - lib/algolia/responses/indexing_response.rb
238
245
  - lib/algolia/responses/multiple_batch_indexing_response.rb
239
246
  - lib/algolia/responses/multiple_response.rb
@@ -269,6 +276,7 @@ files:
269
276
  - test/algolia/integration/base_test.rb
270
277
  - test/algolia/integration/insights_client_test.rb
271
278
  - test/algolia/integration/mocks/mock_requester.rb
279
+ - test/algolia/integration/recommend_client_test.rb
272
280
  - test/algolia/integration/recommendation_client_test.rb
273
281
  - test/algolia/integration/search_client_test.rb
274
282
  - test/algolia/integration/search_index_test.rb
@@ -300,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
308
  - !ruby/object:Gem::Version
301
309
  version: '0'
302
310
  requirements: []
303
- rubygems_version: 3.0.3
311
+ rubygems_version: 3.0.6
304
312
  signing_key:
305
313
  specification_version: 4
306
314
  summary: A simple Ruby client for the algolia.com REST API
@@ -310,6 +318,7 @@ test_files:
310
318
  - test/algolia/integration/base_test.rb
311
319
  - test/algolia/integration/insights_client_test.rb
312
320
  - test/algolia/integration/mocks/mock_requester.rb
321
+ - test/algolia/integration/recommend_client_test.rb
313
322
  - test/algolia/integration/recommendation_client_test.rb
314
323
  - test/algolia/integration/search_client_test.rb
315
324
  - test/algolia/integration/search_index_test.rb