algolia 2.0.0.pre.alpha.4 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +3 -0
  4. data/CHANGELOG.md +12 -0
  5. data/Gemfile +1 -1
  6. data/README.md +18 -10
  7. data/SECURITY.md +3 -0
  8. data/algolia.gemspec +6 -6
  9. data/lib/algolia.rb +1 -1
  10. data/lib/algolia/analytics_client.rb +1 -1
  11. data/lib/algolia/config/analytics_config.rb +2 -2
  12. data/lib/algolia/config/base_config.rb +43 -0
  13. data/lib/algolia/config/insights_config.rb +2 -2
  14. data/lib/algolia/config/recommendation_config.rb +2 -2
  15. data/lib/algolia/config/search_config.rb +2 -2
  16. data/lib/algolia/defaults.rb +2 -2
  17. data/lib/algolia/error.rb +1 -2
  18. data/lib/algolia/helpers.rb +5 -3
  19. data/lib/algolia/insights_client.rb +1 -1
  20. data/lib/algolia/iterators/object_iterator.rb +5 -4
  21. data/lib/algolia/iterators/paginator_iterator.rb +5 -3
  22. data/lib/algolia/recommendation_client.rb +1 -1
  23. data/lib/algolia/search_client.rb +1 -1
  24. data/lib/algolia/search_index.rb +37 -37
  25. data/lib/algolia/transport/request_options.rb +1 -1
  26. data/lib/algolia/transport/transport.rb +2 -5
  27. data/lib/algolia/version.rb +1 -1
  28. data/sig/config/algolia_config.rbs +3 -3
  29. data/sig/config/analytics_config.rbs +1 -1
  30. data/sig/config/insights_config.rbs +1 -1
  31. data/sig/config/recommendation_config.rbs +1 -1
  32. data/sig/config/search_config.rbs +1 -1
  33. data/test/algolia/integration/analytics_client_test.rb +6 -6
  34. data/test/algolia/integration/insights_client_test.rb +11 -11
  35. data/test/algolia/integration/search_client_test.rb +20 -11
  36. data/test/algolia/unit/algolia_config_test.rb +16 -0
  37. data/test/algolia/unit/helpers_test.rb +20 -1
  38. data/test/algolia/unit/retry_strategy_test.rb +3 -3
  39. data/test/test_helper.rb +1 -1
  40. data/upgrade_guide.md +30 -22
  41. metadata +26 -17
  42. data/lib/algolia/config/algolia_config.rb +0 -40
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.0.pre.alpha.4
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-22 00:00:00.000000000 Z
11
+ date: 2020-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,22 @@ dependencies:
56
56
  name: faraday
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.15'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '2.0'
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: '0.15'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.0'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: multi_json
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -178,8 +184,7 @@ dependencies:
178
184
  - - ">="
179
185
  - !ruby/object:Gem::Version
180
186
  version: '0'
181
- description: This is the alpha version of the upcoming v2 release of Algolia Client.
182
- Please keep on using the algoliasearch gem in the meantime.
187
+ description: A simple Ruby client for the algolia.com REST API
183
188
  email:
184
189
  - support@algolia.com
185
190
  executables: []
@@ -192,11 +197,13 @@ files:
192
197
  - ".gitignore"
193
198
  - ".rubocop.yml"
194
199
  - ".rubocop_todo.yml"
200
+ - CHANGELOG.md
195
201
  - CODE_OF_CONDUCT.md
196
202
  - Gemfile
197
203
  - LICENSE
198
204
  - README.md
199
205
  - Rakefile
206
+ - SECURITY.md
200
207
  - Steepfile
201
208
  - algolia.gemspec
202
209
  - bin/console
@@ -204,8 +211,8 @@ files:
204
211
  - lib/algolia.rb
205
212
  - lib/algolia/account_client.rb
206
213
  - lib/algolia/analytics_client.rb
207
- - lib/algolia/config/algolia_config.rb
208
214
  - lib/algolia/config/analytics_config.rb
215
+ - lib/algolia/config/base_config.rb
209
216
  - lib/algolia/config/insights_config.rb
210
217
  - lib/algolia/config/recommendation_config.rb
211
218
  - lib/algolia/config/search_config.rb
@@ -265,19 +272,20 @@ files:
265
272
  - test/algolia/integration/recommendation_client_test.rb
266
273
  - test/algolia/integration/search_client_test.rb
267
274
  - test/algolia/integration/search_index_test.rb
275
+ - test/algolia/unit/algolia_config_test.rb
268
276
  - test/algolia/unit/helpers_test.rb
269
277
  - test/algolia/unit/retry_strategy_test.rb
270
278
  - test/algolia/unit/user_agent_test.rb
271
279
  - test/test_helper.rb
272
280
  - upgrade_guide.md
273
- homepage: https://github.com/algolia/algoliasearch-client-ruby/tree/release/v2
281
+ homepage: https://github.com/algolia/algoliasearch-client-ruby
274
282
  licenses:
275
283
  - MIT
276
284
  metadata:
277
285
  bug_tracker_uri: https://github.com/algolia/algoliasearch-client-ruby/issues
278
- documentation_uri: http://www.rubydoc.info/gems/algolia
279
- source_code_uri: https://github.com/algolia/algoliasearch-client-ruby/tree/release/v2
280
- post_install_message:
286
+ documentation_uri: https://www.algolia.com/doc/api-client/getting-started/install/ruby
287
+ source_code_uri: https://github.com/algolia/algoliasearch-client-ruby
288
+ post_install_message:
281
289
  rdoc_options: []
282
290
  require_paths:
283
291
  - lib
@@ -288,14 +296,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
296
  version: '0'
289
297
  required_rubygems_version: !ruby/object:Gem::Requirement
290
298
  requirements:
291
- - - ">"
299
+ - - ">="
292
300
  - !ruby/object:Gem::Version
293
- version: 1.3.1
301
+ version: '0'
294
302
  requirements: []
295
- rubygems_version: 3.0.4
296
- signing_key:
303
+ rubygems_version: 3.0.3
304
+ signing_key:
297
305
  specification_version: 4
298
- summary: A simple Ruby client for the algolia.com REST API (alpha release)
306
+ summary: A simple Ruby client for the algolia.com REST API
299
307
  test_files:
300
308
  - test/algolia/integration/account_client_test.rb
301
309
  - test/algolia/integration/analytics_client_test.rb
@@ -305,6 +313,7 @@ test_files:
305
313
  - test/algolia/integration/recommendation_client_test.rb
306
314
  - test/algolia/integration/search_client_test.rb
307
315
  - test/algolia/integration/search_index_test.rb
316
+ - test/algolia/unit/algolia_config_test.rb
308
317
  - test/algolia/unit/helpers_test.rb
309
318
  - test/algolia/unit/retry_strategy_test.rb
310
319
  - test/algolia/unit/user_agent_test.rb
@@ -1,40 +0,0 @@
1
- require 'faraday'
2
-
3
- module Algolia
4
- # Class AlgoliaConfig
5
- class AlgoliaConfig
6
- attr_accessor :app_id, :api_key, :default_headers, :batch_size, :read_timeout, :write_timeout, :connect_timeout, :compression_type,
7
- :symbolize_keys
8
-
9
- #
10
- # @option options [String] :app_id
11
- # @option options [String] :api_key
12
- # @option options [Integer] :batch_size
13
- # @option options [Integer] :read_timeout
14
- # @option options [Integer] :write_timeout
15
- # @option options [Integer] :connect_timeout
16
- # @option options [Boolean] :symbolize_keys
17
- #
18
- def initialize(opts = {})
19
- raise AlgoliaError, 'No Application ID provided, please set :app_id' unless opts.has_key?(:app_id)
20
- raise AlgoliaError, 'No API key provided, please set :api_key' unless opts.has_key?(:api_key)
21
-
22
- @app_id = opts[:app_id]
23
- @api_key = opts[:api_key]
24
-
25
- @default_headers = {
26
- Defaults::HEADER_API_KEY => @api_key,
27
- Defaults::HEADER_APP_ID => @app_id,
28
- 'Content-Type' => 'application/json; charset=utf-8',
29
- 'User-Agent' => UserAgent.value
30
- }
31
-
32
- @batch_size = opts[:batch_size] || Defaults::BATCH_SIZE
33
- @read_timeout = opts[:read_timeout] || Defaults::READ_TIMEOUT
34
- @write_timeout = opts[:write_timeout] || Defaults::WRITE_TIMEOUT
35
- @connect_timeout = opts[:connect_timeout] || Defaults::CONNECT_TIMEOUT
36
- @compression_type = opts[:compression_type] || Defaults::NONE_ENCODING
37
- @symbolize_keys = opts[:symbolize_keys] || true
38
- end
39
- end
40
- end