algolia 2.2.5 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05fcc0d3405e2cb770d7c30610c19951d4f4845723d03c62bd3143cf78cd2f49
4
- data.tar.gz: 49ab3c5104e38c993b2c6962062f81834c0d24cf46f1bdc002435f4177fa94cb
3
+ metadata.gz: 15b704f5d3b08b2b064ca27bfc35af576f484dab073bd741836cf89c7e74f886
4
+ data.tar.gz: 3bfa9e4d09abbbdf0d3072ec9d80918760329a2d5c2f1395839d67aa9756e618
5
5
  SHA512:
6
- metadata.gz: 40e6ff905fe540cc559cb622de99a5e14248b9be734700ed74af17851f13112450b00cba050a852a936ab208a77ddc49999a4e00a858fad288dbcdd46f2dc857
7
- data.tar.gz: 4051ca27f08a45ff9ba03621449f2d7fcaff34b95f712657727c9b5aacce3cd2a2bba27fba5758ab225efcdb33329e178feb6a8bfa8e59dc720cf4320473e19f
6
+ metadata.gz: 990ea9edd9af11f73466bb889748bf59849a55aa2641c4f30042dc606f2bd0f79f5ddb5c474f9e5630a6bce4410d2e550dfa5cbd4b77194c097bf7de48d2e235
7
+ data.tar.gz: 3a28d34bf348a1ea25212706151b18fa7922e58020c66d947ba28b214b5c302e59509ef8f9fe1fe16b698bbbb2ac6f89e15f6f0052e82f168a4dcd522f550d6d
data/.circleci/config.yml CHANGED
@@ -131,14 +131,14 @@ workflows:
131
131
  - test_ruby:
132
132
  matrix:
133
133
  parameters:
134
- version: ['2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0']
134
+ version: ['2.4', '2.5', '2.6', '2.7', '3.0']
135
135
  filters:
136
136
  tags:
137
137
  only: /.*/
138
138
  - test_jruby:
139
139
  matrix:
140
140
  parameters:
141
- version: ['9.1', '9.2']
141
+ version: ['9.2']
142
142
  filters:
143
143
  tags:
144
144
  only: /.*/
data/CHANGELOG.md CHANGED
@@ -1,11 +1,18 @@
1
1
  # ChangeLog
2
2
 
3
- ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.4..master)
3
+ ## [Unreleased](https://github.com/algolia/algoliasearch-client-ruby/compare/2.3.0..master)
4
+
5
+ ## [2.3.0](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.5...2.3.0) (2022-09-26)
6
+ ### Changed
7
+ - Dropped support for Ruby < 2.4 ([`#483`](https://github.com/algolia/algoliasearch-client-ruby/pull/483))
8
+ - Updated Faraday dependency range ([`#471`](https://github.com/algolia/algoliasearch-client-ruby/pull/471))
9
+ - Fixed bug with `createIfNotExists` ([`#458`](https://github.com/algolia/algoliasearch-client-ruby/pull/458))
10
+ - Use user-configured logger to temp client ([`#480`](https://github.com/algolia/algoliasearch-client-ruby/pull/480))
4
11
 
5
12
  ## [2.2.5](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.4...2.2.5) (2022-05-24)
6
13
  ### Fixed
7
14
  - multiple_queries: allow params to be `nil` ([`#478`](https://github.com/algolia/algoliasearch-client-ruby/pull/478))
8
- -
15
+
9
16
  ## [2.2.4](https://github.com/algolia/algoliasearch-client-ruby/compare/2.2.3...2.2.4) (2022-05-24)
10
17
  ### Fixed
11
18
  - API endpoint URL mishandling in get_settings method ([`#473`](https://github.com/algolia/algoliasearch-client-ruby/pull/473))
data/README.md CHANGED
@@ -25,7 +25,7 @@
25
25
  ## ✨ Features
26
26
 
27
27
  - Thin & minimal low-level HTTP client to interact with Algolia's API
28
- - Supports Ruby `^2.2`.
28
+ - Supports Ruby `^2.4`.
29
29
 
30
30
  ## 💡 Getting Started
31
31
 
data/algolia.gemspec CHANGED
@@ -35,7 +35,9 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'rake'
36
36
  spec.add_development_dependency 'rubocop', '<= 0.82.0'
37
37
 
38
- spec.add_dependency 'faraday', ['>= 0.15', '< 2.0']
38
+ spec.add_dependency 'faraday', ['>= 0.15', '< 3']
39
+ spec.add_dependency 'faraday-net_http_persistent', ['>= 0.15', '< 3']
40
+
39
41
  spec.add_dependency 'multi_json', '~> 1.0'
40
42
  spec.add_dependency 'net-http-persistent'
41
43
 
@@ -19,8 +19,8 @@ module Algolia
19
19
  def initialize(search_config, opts = {})
20
20
  @config = search_config
21
21
  adapter = opts[:adapter] || Defaults::ADAPTER
22
- logger = opts[:logger] || LoggerHelper.create
23
- requester = opts[:http_requester] || Defaults::REQUESTER_CLASS.new(adapter, logger)
22
+ @logger = opts[:logger] || LoggerHelper.create
23
+ requester = opts[:http_requester] || Defaults::REQUESTER_CLASS.new(adapter, @logger)
24
24
  @transporter = Transport::Transport.new(@config, requester)
25
25
  end
26
26
 
@@ -94,7 +94,7 @@ module Algolia
94
94
  if stripped_index_name.empty?
95
95
  raise AlgoliaError, 'Please provide a valid index name'
96
96
  end
97
- Index.new(stripped_index_name, @transporter, @config)
97
+ Index.new(stripped_index_name, @transporter, @config, @logger)
98
98
  end
99
99
 
100
100
  # List all indexes of the client
@@ -5,18 +5,20 @@ module Algolia
5
5
  include CallType
6
6
  include Helpers
7
7
 
8
- attr_reader :name, :transporter, :config
8
+ attr_reader :name, :transporter, :config, :logger
9
9
 
10
10
  # Initialize an index
11
11
  #
12
12
  # @param name [String] name of the index
13
13
  # @param transporter [Object] transport object used for the connection
14
14
  # @param config [Config] a Config object which contains your APP_ID and API_KEY
15
+ # @param logger [LoggerHelper] an optional LoggerHelper object to use
15
16
  #
16
- def initialize(name, transporter, config)
17
+ def initialize(name, transporter, config, logger = nil)
17
18
  @name = name
18
19
  @transporter = transporter
19
20
  @config = config
21
+ @logger = logger || LoggerHelper.create
20
22
  end
21
23
 
22
24
  # # # # # # # # # # # # # # # # # # # # #
@@ -301,8 +303,8 @@ module Algolia
301
303
  request_options = symbolize_hash(opts)
302
304
  if get_option(request_options, 'createIfNotExists')
303
305
  generate_object_id = true
304
- request_options.delete(:createIfNotExists)
305
306
  end
307
+ request_options.delete(:createIfNotExists)
306
308
 
307
309
  if generate_object_id
308
310
  IndexingResponse.new(self, raw_batch(chunk('partialUpdateObject', objects), request_options))
@@ -830,7 +832,7 @@ module Algolia
830
832
  end
831
833
 
832
834
  # TODO: consider create a new client with state of retry is shared
833
- tmp_client = Algolia::Search::Client.new(@config)
835
+ tmp_client = Algolia::Search::Client.new(@config, { logger: logger })
834
836
  tmp_index = tmp_client.init_index(tmp_index_name)
835
837
 
836
838
  save_objects_response = tmp_index.save_objects(objects, request_options)
@@ -1,4 +1,6 @@
1
1
  require 'faraday'
2
+ # this is the default adapter and it needs to be required to be registered.
3
+ require 'faraday/net_http_persistent'
2
4
 
3
5
  module Algolia
4
6
  module Transport
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = '2.2.5'.freeze
2
+ VERSION = '2.3.0'.freeze
3
3
  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.2.5
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-24 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,7 +61,7 @@ dependencies:
61
61
  version: '0.15'
62
62
  - - "<"
63
63
  - !ruby/object:Gem::Version
64
- version: '2.0'
64
+ version: '3'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,7 +71,27 @@ dependencies:
71
71
  version: '0.15'
72
72
  - - "<"
73
73
  - !ruby/object:Gem::Version
74
- version: '2.0'
74
+ version: '3'
75
+ - !ruby/object:Gem::Dependency
76
+ name: faraday-net_http_persistent
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0.15'
82
+ - - "<"
83
+ - !ruby/object:Gem::Version
84
+ version: '3'
85
+ type: :runtime
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0.15'
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '3'
75
95
  - !ruby/object:Gem::Dependency
76
96
  name: multi_json
77
97
  requirement: !ruby/object:Gem::Requirement
@@ -312,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
332
  - !ruby/object:Gem::Version
313
333
  version: '0'
314
334
  requirements: []
315
- rubygems_version: 3.0.6
335
+ rubygems_version: 3.0.3.1
316
336
  signing_key:
317
337
  specification_version: 4
318
338
  summary: A simple Ruby client for the algolia.com REST API