faraday 2.12.2 → 2.12.3

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: bfb424c45e703a33fd819b31c8ee41c9e4e30874b280530a19ce8ae320570ef9
4
- data.tar.gz: c1a1a5b7aab4f393908958701959f7b41fd303ca4da906c1b4c0581a13c590db
3
+ metadata.gz: 1434b95a4b157a48f4279e2341946ed2d2ca0fd5547e88cae6b531c6be1e3bb0
4
+ data.tar.gz: 947e3e3751d9e2a717d4b28278285cc825eb292a93273d97571d3cde4f77f923
5
5
  SHA512:
6
- metadata.gz: 6d4d18e2006ac83dfd22aff834b4fe3c983bfbf578b6850944d35cfbb1ca40ba58ce07414821bc3e604ca3310c85500d5d2b8de7c33b0e6147f24484fcae688f
7
- data.tar.gz: 9cc8057d003f09a02bbdb9a29b920003beff58391c3bf86838ae61b2e9aaac4782d5764286f824b24d486e8dee202cc2d892ec3f658db6b710d5088d5836be3c
6
+ metadata.gz: 5e5d06c952784a9bd7f0b6a610188a0e00a8415fd5ccb35bc07fe4c9426fc5de10f8975bc069d85a13f5cc6f48ab291433d9565ab1f17112fac595e4aef50660
7
+ data.tar.gz: 58b30aa3c0aa2d635839019358931fec2be300a8a59078240aea4541696e9aa5445106783d8281de0a1ec0e67c81ac9c3d1a08d2c4594caf14099753eb0b3d9d
@@ -22,8 +22,10 @@ module Faraday
22
22
  when URI
23
23
  value = { uri: value }
24
24
  when Hash, Options
25
- if (uri = value.delete(:uri))
26
- value[:uri] = Utils.URI(uri)
25
+ if value[:uri]
26
+ value = value.dup.tap do |duped|
27
+ duped[:uri] = Utils.URI(duped[:uri])
28
+ end
27
29
  end
28
30
  end
29
31
 
@@ -27,10 +27,11 @@ module Faraday
27
27
 
28
28
  attr_reader :name
29
29
 
30
- ruby2_keywords def initialize(klass, *args, &block)
30
+ def initialize(klass, *args, **kwargs, &block)
31
31
  @name = klass.to_s
32
32
  REGISTRY.set(klass) if klass.respond_to?(:name)
33
33
  @args = args
34
+ @kwargs = kwargs
34
35
  @block = block
35
36
  end
36
37
 
@@ -53,7 +54,7 @@ module Faraday
53
54
  end
54
55
 
55
56
  def build(app = nil)
56
- klass.new(app, *@args, &@block)
57
+ klass.new(app, *@args, **@kwargs, &@block)
57
58
  end
58
59
  end
59
60
 
@@ -106,11 +107,11 @@ module Faraday
106
107
  use_symbol(Faraday::Response, ...)
107
108
  end
108
109
 
109
- ruby2_keywords def adapter(klass = NO_ARGUMENT, *args, &block)
110
+ def adapter(klass = NO_ARGUMENT, *args, **kwargs, &block)
110
111
  return @adapter if klass == NO_ARGUMENT || klass.nil?
111
112
 
112
113
  klass = Faraday::Adapter.lookup_middleware(klass) if klass.is_a?(Symbol)
113
- @adapter = self.class::Handler.new(klass, *args, &block)
114
+ @adapter = self.class::Handler.new(klass, *args, **kwargs, &block)
114
115
  end
115
116
 
116
117
  ## methods to push onto the various positions in the stack:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faraday
4
- VERSION = '2.12.2'
4
+ VERSION = '2.12.3'
5
5
  end
@@ -27,6 +27,33 @@ RSpec.describe Faraday::ProxyOptions do
27
27
  expect(options.inspect).to eq('#<Faraday::ProxyOptions (empty)>')
28
28
  end
29
29
 
30
+ it 'works with hash' do
31
+ hash = { user: 'user', password: 'pass', uri: 'http://@example.org' }
32
+ options = Faraday::ProxyOptions.from(hash)
33
+ expect(options.user).to eq('user')
34
+ expect(options.password).to eq('pass')
35
+ expect(options.uri).to be_a_kind_of(URI)
36
+ expect(options.path).to eq('')
37
+ expect(options.port).to eq(80)
38
+ expect(options.host).to eq('example.org')
39
+ expect(options.scheme).to eq('http')
40
+ expect(options.inspect).to match('#<Faraday::ProxyOptions uri=')
41
+ end
42
+
43
+ it 'works with option' do
44
+ opt_arg = { user: 'user', password: 'pass', uri: 'http://@example.org' }
45
+ option = Faraday::ConnectionOptions.from(proxy: opt_arg)
46
+ options = Faraday::ProxyOptions.from(option.proxy)
47
+ expect(options.user).to eq('user')
48
+ expect(options.password).to eq('pass')
49
+ expect(options.uri).to be_a_kind_of(URI)
50
+ expect(options.path).to eq('')
51
+ expect(options.port).to eq(80)
52
+ expect(options.host).to eq('example.org')
53
+ expect(options.scheme).to eq('http')
54
+ expect(options.inspect).to match('#<Faraday::ProxyOptions uri=')
55
+ end
56
+
30
57
  it 'works with no auth' do
31
58
  proxy = Faraday::ProxyOptions.from 'http://example.org'
32
59
  expect(proxy.user).to be_nil
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.2
4
+ version: 2.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@technoweenie"
8
8
  - "@iMacTia"
9
9
  - "@olleolleolle"
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-12-09 00:00:00.000000000 Z
12
+ date: 2025-04-08 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: faraday-net_http
@@ -60,7 +59,6 @@ dependencies:
60
59
  - - ">="
61
60
  - !ruby/object:Gem::Version
62
61
  version: '0'
63
- description:
64
62
  email: technoweenie@gmail.com
65
63
  executables: []
66
64
  extensions: []
@@ -146,11 +144,10 @@ licenses:
146
144
  - MIT
147
145
  metadata:
148
146
  homepage_uri: https://lostisland.github.io/faraday
149
- changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.12.2
147
+ changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.12.3
150
148
  source_code_uri: https://github.com/lostisland/faraday
151
149
  bug_tracker_uri: https://github.com/lostisland/faraday/issues
152
150
  rubygems_mfa_required: 'true'
153
- post_install_message:
154
151
  rdoc_options: []
155
152
  require_paths:
156
153
  - lib
@@ -166,8 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
163
  - !ruby/object:Gem::Version
167
164
  version: '0'
168
165
  requirements: []
169
- rubygems_version: 3.5.22
170
- signing_key:
166
+ rubygems_version: 3.6.2
171
167
  specification_version: 4
172
168
  summary: HTTP/REST API client library.
173
169
  test_files: []