faraday 2.10.0 → 2.11.0

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: 38164352c529ba998b6bf30d524aab2a4ada891fbffd2043148d1d8022ea4948
4
- data.tar.gz: 2f0ffedf44bd70095af902f953dc3c61a16ee471f392954d5085e6143bc0bdff
3
+ metadata.gz: 7ceee5efaef78f039d68da91b621e8ae3723f6663fc11667709845b08358bb53
4
+ data.tar.gz: 430834e5a0cecbc636eecf485eae7061447126e93b5de5f27ad2d7a938a36459
5
5
  SHA512:
6
- metadata.gz: 6b1f592fa1199f33f688304d02f544655593990f6202ec6ae970064f5f2699b2cf66962b3e26f087edea76c66eca048907358d5d9c9bb809beb405008d0395e8
7
- data.tar.gz: '081ad3877890fb49a0b3cd3ade3924fd5b482bc1a7624a3d56701096e90bee49c2d2619b6454dfa604a67f81cf0682bbe7acd1eb0f3247bc2790e8a7afded7a5'
6
+ metadata.gz: 9664749d4913670b04ed973554bf2893fb17f63eb5117a86a36d083615421cbca07212f4797e2869f1ec86905e428f9de89c913c142464bdb6764316ad4edeae
7
+ data.tar.gz: c2d7c4259cfceb8f862e4ea45f8bf7f8f3a7c1896478b882f349539270aac8161fb079b29b0f4fa29b57539a395e9a9d7f62f65ecd76433746373dc0243200b4
data/CHANGELOG.md CHANGED
@@ -517,7 +517,7 @@ Breaking changes:
517
517
  - Drop support for Ruby 1.8
518
518
 
519
519
  Features:
520
- - Include wrapped exception/reponse in ClientErrors
520
+ - Include wrapped exception/response in ClientErrors
521
521
  - Add `response.reason_phrase`
522
522
  - Provide option to selectively skip logging request/response headers
523
523
  - Add regex support for pattern matching in `test` adapter
@@ -314,15 +314,23 @@ module Faraday
314
314
  #
315
315
  # @yield a block to execute multiple requests.
316
316
  # @return [void]
317
- def in_parallel(manager = nil)
317
+ def in_parallel(manager = nil, &block)
318
318
  @parallel_manager = manager || default_parallel_manager do
319
319
  warn 'Warning: `in_parallel` called but no parallel-capable adapter ' \
320
320
  'on Faraday stack'
321
321
  warn caller[2, 10].join("\n")
322
322
  nil
323
323
  end
324
- yield
325
- @parallel_manager&.run
324
+ return yield unless @parallel_manager
325
+
326
+ if @parallel_manager.respond_to?(:execute)
327
+ # Execute is the new method that is responsible for executing the block.
328
+ @parallel_manager.execute(&block)
329
+ else
330
+ # TODO: Old behaviour, deprecate and remove in 3.0
331
+ yield
332
+ @parallel_manager.run
333
+ end
326
334
  ensure
327
335
  @parallel_manager = nil
328
336
  end
@@ -10,6 +10,7 @@ module Faraday
10
10
  attr_reader :app, :options
11
11
 
12
12
  DEFAULT_OPTIONS = {}.freeze
13
+ LOCK = Mutex.new
13
14
 
14
15
  def initialize(app = nil, options = {})
15
16
  @app = app
@@ -27,7 +28,7 @@ module Faraday
27
28
  #
28
29
  def default_options=(options = {})
29
30
  validate_default_options(options)
30
- lock.synchronize do
31
+ LOCK.synchronize do
31
32
  @default_options = default_options.merge(options)
32
33
  end
33
34
  end
@@ -41,10 +42,6 @@ module Faraday
41
42
 
42
43
  private
43
44
 
44
- def lock
45
- @lock ||= Monitor.new
46
- end
47
-
48
45
  def validate_default_options(options)
49
46
  invalid_keys = options.keys.reject { |opt| self::DEFAULT_OPTIONS.key?(opt) }
50
47
  return unless invalid_keys.any?
@@ -46,12 +46,15 @@ module Faraday
46
46
  # #
47
47
  # # @!attribute max_version
48
48
  # # @return [String, Symbol] maximum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D)
49
+ # #
50
+ # # @!attribute ciphers
51
+ # # @return [String] cipher list in OpenSSL format (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D)
49
52
  # class SSLOptions < Options; end
50
53
  SSLOptions = Options.new(:verify, :verify_hostname,
51
54
  :ca_file, :ca_path, :verify_mode,
52
55
  :cert_store, :client_cert, :client_key,
53
56
  :certificate, :private_key, :verify_depth,
54
- :version, :min_version, :max_version) do
57
+ :version, :min_version, :max_version, :ciphers) do
55
58
  # @return [Boolean] true if should verify
56
59
  def verify?
57
60
  verify != false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faraday
4
- VERSION = '2.10.0'
4
+ VERSION = '2.11.0'
5
5
  end
@@ -103,7 +103,8 @@ RSpec.describe Faraday::Utils do
103
103
  version: '2',
104
104
  min_version: nil,
105
105
  max_version: nil,
106
- verify_hostname: nil
106
+ verify_hostname: nil,
107
+ ciphers: nil
107
108
  }
108
109
  end
109
110
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@technoweenie"
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-07-08 00:00:00.000000000 Z
13
+ date: 2024-08-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday-net_http
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.0'
22
22
  - - "<"
23
23
  - !ruby/object:Gem::Version
24
- version: '3.2'
24
+ version: '3.4'
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -31,7 +31,7 @@ dependencies:
31
31
  version: '2.0'
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
- version: '3.2'
34
+ version: '3.4'
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: logger
37
37
  requirement: !ruby/object:Gem::Requirement
@@ -132,9 +132,10 @@ licenses:
132
132
  - MIT
133
133
  metadata:
134
134
  homepage_uri: https://lostisland.github.io/faraday
135
- changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.10.0
135
+ changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.11.0
136
136
  source_code_uri: https://github.com/lostisland/faraday
137
137
  bug_tracker_uri: https://github.com/lostisland/faraday/issues
138
+ rubygems_mfa_required: 'true'
138
139
  post_install_message:
139
140
  rdoc_options: []
140
141
  require_paths: