elastic-transport 8.1.0.pre1 → 8.1.0.pre2

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: 8b066c34f0b23cddd1cb3da7667df6889e749f93241838edbf7ce82aa45a08b5
4
- data.tar.gz: 054ac019e3aa6b50526694696af8bbcd51be8a3c79ff8165486011581d0615f3
3
+ metadata.gz: '019bec0fce3232610f573b32a72456674018954609728aba574165f3e4b16393'
4
+ data.tar.gz: 9f5ef21b2823bccf5c6e22c47420bf543931b1b76cd3b7050272cababffe2929
5
5
  SHA512:
6
- metadata.gz: 279d92ef2d6df1909d7d6b537ba9283c24d2791dc9c85c3e05330bd65b580356511c8412a987ee788eeee8ac0a0600624d0b4a42eddf386d988f879299947dc4
7
- data.tar.gz: 1e9266023daa113c11df4a1913d27b68aa81034d951487ccd5ed08a73011827d4ecdb409eaafbc360785286b52bbe00299447ac7820def9741817f9ca66b794b
6
+ metadata.gz: 623ad8af7121423ae67655c684293a14f41faffbf76368fc8b2b4b23ce0a48793d238b209d3f8867808a8567b496d6186c8e700be9371d59839154f460f52eb3
7
+ data.tar.gz: 7cdbcbcb8ab41e11a1a3acd5de8b25520b10823e2706cc8d432fb7057d06181cb0730272289614b34302182d925b82d31a422a0a664c461051db34ce81c3939d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 8.1.0.pre2
2
+
3
+ Updates Faraday's adapter detection code.
4
+
1
5
  ## 8.1.0.pre1
2
6
 
3
7
  Adds support for Faraday version 2. From [Faraday's Upgrading guide](https://github.com/lostisland/faraday/blob/main/UPGRADING.md#faraday-20), the main change is the adapters have moved:
@@ -283,24 +283,26 @@ module Elastic
283
283
  # Auto-detect the best adapter (HTTP "driver") available, based on libraries
284
284
  # loaded by the user, preferring those with persistent connections
285
285
  # ("keep-alive") by default
286
+ # Check adapters based on the usage of Faraday 1 or 2. Faraday should be defined here
287
+ # since this is only called when transport class is Transport::HTTP::Faraday
286
288
  #
287
289
  # @return [Symbol]
288
290
  #
289
291
  # @api private
290
292
  #
291
293
  def __auto_detect_adapter
292
- case
293
- when defined?(::Patron)
294
- :patron
295
- when defined?(::Typhoeus)
296
- :typhoeus
297
- when defined?(::HTTPClient)
298
- :httpclient
299
- when defined?(::Net::HTTP::Persistent)
300
- :net_http_persistent
294
+ if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new(2)
295
+ return :patron if defined?(Faraday::Adapter::Patron)
296
+ return :typhoeus if defined?(Faraday::Adapter::Typhoeus)
297
+ return :httpclient if defined?(Faraday::Adapter::HTTPClient)
298
+ return :net_http_persistent if defined?(Faraday::Adapter::NetHttpPersistent)
301
299
  else
302
- ::Faraday.default_adapter
300
+ return :patron if defined?(::Patron)
301
+ return :typhoeus if defined?(::Typhoeus)
302
+ return :httpclient if defined?(::HTTPClient)
303
+ return :net_http_persistent if defined?(::Net::HTTP::Persistent)
303
304
  end
305
+ ::Faraday.default_adapter
304
306
  end
305
307
  end
306
308
  end
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elastic
19
19
  module Transport
20
- VERSION = '8.1.0.pre1'.freeze
20
+ VERSION = '8.1.0.pre2'.freeze
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.0.pre1
4
+ version: 8.1.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-08-15 00:00:00.000000000 Z
13
+ date: 2022-08-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday