async-http-faraday 0.10.0 → 0.12.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: c3de5d2e0aeda370b0fb885fb00abe5781492da63ee7ba7a0b36da91ea15df75
4
- data.tar.gz: a5fc3ac76a50db186cadf826c4e458029b337574ad9771365f2015d0be30a276
3
+ metadata.gz: bb8d8e1aa9d79153243004581a6e6c7c68591a87856944f99ab383787b873999
4
+ data.tar.gz: 975a58648df70b91f5d2c8bb3073bc1bb6f86ecebdf155a2c87132d7dacace18
5
5
  SHA512:
6
- metadata.gz: 29096ef34c9bda8c50c62422cfd9a353c331d91fb3a61c8d621e90a0c8d7c0b12ff591f3e520e2c485a84e8f6c1519153d9c36f18e8a90bf627719d7787f6adb
7
- data.tar.gz: 9ee7b48f082dc8297ff05164988095d2ffcb3954a6b68c86eb52e7a0d2f348f83a5dc7209232c71c898a0d53b522172b7210b6e1b5da0e98a88a69a8e07c8ff1
6
+ metadata.gz: ec5ffb04ddb5457593b11d188aacf7572b32dcf40d6c355f8e5f62103d576af91461409355a745d948f5ac0973b52b0782d64f61eef173f116315083a37eee82
7
+ data.tar.gz: 2ddd238bfaf76167a2c95b233482c909fee7f280170d93b87569ab8c284d2c61e211e4d2c2eb6fad35a682af6d9428ae432a1aa6713a6250c5f09d0ea98af8db
checksums.yaml.gz.sig ADDED
Binary file
data/examples/topics.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ # Released under the MIT License.
5
+ # Copyright, 2020, by Samuel Williams.
6
+
4
7
  $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
5
8
 
6
9
  require 'async'
data/lib/.DS_Store CHANGED
Binary file
@@ -1,31 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2018-2021, by Samuel Williams.
5
+ # Copyright, 2018, by Andreas Garnaes.
6
+ # Copyright, 2019, by Denis Talakevich.
7
+ # Copyright, 2019-2020, by Igor Sidorov.
8
+ # Copyright, 2023, by Genki Takiuchi.
9
+ # Copyright, 2023, by Flavio Fernandes.
22
10
 
23
11
  require 'faraday'
24
12
  require 'faraday/adapter'
25
13
  require 'kernel/sync'
26
- require 'async/http/internet'
27
14
 
28
- require_relative 'agent'
15
+ require 'async/http/client'
16
+ require 'async/http/proxy'
29
17
 
30
18
  module Async
31
19
  module HTTP
@@ -44,26 +32,85 @@ module Async
44
32
  SocketError
45
33
  ].freeze
46
34
 
47
- def initialize(*arguments, **options, &block)
48
- super
35
+ def initialize(*arguments, timeout: nil, **options, &block)
36
+ super(*arguments, **options)
37
+
38
+ @timeout = timeout
39
+
40
+ @clients = {}
41
+
42
+ @options = options
43
+ end
44
+
45
+ def make_client(endpoint)
46
+ Client.new(endpoint, **@connection_options)
47
+ end
48
+
49
+ def host_key(endpoint)
50
+ url = endpoint.url.dup
51
+
52
+ url.path = ""
53
+ url.fragment = nil
54
+ url.query = nil
55
+
56
+ return url
57
+ end
58
+
59
+ def client_for(endpoint)
60
+ key = host_key(endpoint)
61
+
62
+ @clients.fetch(key) do
63
+ @clients[key] = make_client(endpoint)
64
+ end
65
+ end
66
+
67
+ def proxy_client_for(proxy_endpoint, endpoint)
68
+ key = [host_key(proxy_endpoint), host_key(endpoint)]
49
69
 
50
- @internet = Async::HTTP::Internet.new
51
- @persistent = options.fetch(:persistent, true)
52
- @timeout = options[:timeout]
70
+ @clients.fetch(key) do
71
+ client = client_for(proxy_endpoint)
72
+ @clients[key] = client.proxied_client(endpoint)
73
+ end
53
74
  end
54
75
 
55
76
  def close
56
- @internet.close
77
+ # The order of operations here is to avoid a race condition between iterating over clients (#close may yield) and creating new clients.
78
+ clients = @clients.values
79
+
80
+ @clients.clear
81
+
82
+ clients.each(&:close)
57
83
  end
58
84
 
59
85
  def call(env)
60
86
  super
61
87
 
62
88
  Sync do
89
+ endpoint = Endpoint.new(env.url)
90
+
91
+ if proxy = env.request.proxy
92
+ proxy_endpoint = Endpoint.new(proxy.uri)
93
+ client = self.proxy_client_for(proxy_endpoint, endpoint)
94
+ else
95
+ client = self.client_for(endpoint)
96
+ end
97
+
98
+ if body = env.body
99
+ body = Body::Buffered.wrap(body)
100
+ end
101
+
102
+ if headers = env.request_headers
103
+ headers = ::Protocol::HTTP::Headers[headers]
104
+ end
105
+
106
+ method = env.method.to_s.upcase
107
+
108
+ request = ::Protocol::HTTP::Request.new(endpoint.scheme, endpoint.authority, method, endpoint.path, nil, headers, body)
109
+
63
110
  with_timeout do
64
- response = @internet.call(env[:method].to_s.upcase, env[:url].to_s, env[:request_headers], env[:body] || [])
111
+ response = client.call(request)
65
112
 
66
- save_response(env, response.status, response.read, response.headers)
113
+ save_response(env, response.status, encoded_body(response), response.headers)
67
114
  end
68
115
  end
69
116
 
@@ -87,6 +134,32 @@ module Async
87
134
  yield
88
135
  end
89
136
  end
137
+
138
+ def encoded_body(response)
139
+ body = response.read
140
+ return body if body.nil?
141
+ content_type = response.headers['content-type']
142
+ return body unless content_type
143
+ params = extract_type_parameters(content_type)
144
+ if charset = params['charset']
145
+ body = body.dup if body.frozen?
146
+ body.force_encoding(charset)
147
+ end
148
+ body
149
+ rescue ArgumentError
150
+ nil
151
+ end
152
+
153
+ def extract_type_parameters(content_type)
154
+ result = {}
155
+ list = content_type.split(';')
156
+ list.shift
157
+ list.each do |param|
158
+ key, value = *param.split('=', 2)
159
+ result[key.strip] = value.strip
160
+ end
161
+ result
162
+ end
90
163
  end
91
164
  end
92
165
  end
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2020, by Samuel Williams.
22
5
 
23
6
  require_relative 'adapter'
24
7
 
@@ -1,29 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2018-2021, by Samuel Williams.
22
5
 
23
6
  module Async
24
7
  module HTTP
25
8
  module Faraday
26
- VERSION = "0.10.0"
9
+ VERSION = "0.12.0"
27
10
  end
28
11
  end
29
12
  end
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # Released under the MIT License.
4
+ # Copyright, 2018-2020, by Samuel Williams.
22
5
 
23
6
  require_relative "faraday/version"
24
7
  require_relative "faraday/adapter"
data/license.md ADDED
@@ -0,0 +1,28 @@
1
+ # MIT License
2
+
3
+ Copyright, 2018-2021, by Samuel Williams.
4
+ Copyright, 2018, by Andreas Garnaes.
5
+ Copyright, 2019, by Denis Talakevich.
6
+ Copyright, 2019-2020, by Igor Sidorov.
7
+ Copyright, 2020-2021, by Olle Jonsson.
8
+ Copyright, 2020, by Benoit Daloze.
9
+ Copyright, 2023, by Genki Takiuchi.
10
+ Copyright, 2023, by Flavio Fernandes.
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
data/readme.md ADDED
@@ -0,0 +1,85 @@
1
+ # Async::HTTP::Faraday
2
+
3
+ Provides an adaptor for [Faraday](https://github.com/lostisland/faraday) to perform async HTTP requests. If you are designing a new library, you should probably just use `Async::HTTP::Client` directly.
4
+
5
+ [![Development Status](https://github.com/socketry/async-http-faraday/workflows/Test/badge.svg)](https://github.com/socketry/async-http-faraday/actions?workflow=Test)
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ``` ruby
12
+ gem 'async-http-faraday'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install async-http-faraday
22
+
23
+ ## Usage
24
+
25
+ Here is how you set faraday to use `Async::HTTP`:
26
+
27
+ ``` ruby
28
+ require 'async/http/faraday'
29
+
30
+ # Make it the global default:
31
+ Faraday.default_adapter = :async_http
32
+
33
+ # Per connection:
34
+ conn = Faraday.new(...) do |faraday|
35
+ faraday.adapter :async_http
36
+ end
37
+ ```
38
+
39
+ Here is how you make a request:
40
+
41
+ ``` ruby
42
+ Async do
43
+ response = conn.get("/index")
44
+ end
45
+ ```
46
+
47
+ ### Default
48
+
49
+ To make this the default adaptor:
50
+
51
+ ``` ruby
52
+ require 'async/http/faraday/default'
53
+ ```
54
+
55
+ ## Contributing
56
+
57
+ 1. Fork it
58
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
59
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
60
+ 4. Push to the branch (`git push origin my-new-feature`)
61
+ 5. Create new Pull Request
62
+
63
+ ## License
64
+
65
+ Released under the MIT license.
66
+
67
+ Copyright, 2015, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
68
+
69
+ Permission is hereby granted, free of charge, to any person obtaining a copy
70
+ of this software and associated documentation files (the "Software"), to deal
71
+ in the Software without restriction, including without limitation the rights
72
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
73
+ copies of the Software, and to permit persons to whom the Software is
74
+ furnished to do so, subject to the following conditions:
75
+
76
+ The above copyright notice and this permission notice shall be included in
77
+ all copies or substantial portions of the Software.
78
+
79
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
80
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
82
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
83
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
84
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
85
+ THE SOFTWARE.
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http-faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - Igor Sidorov
9
+ - Andreas Garnaes
10
+ - Olle Jonsson
11
+ - Benoit Daloze
12
+ - Denis Talakevich
13
+ - Flavio Fernandes
14
+ - Genki Takiuchi
8
15
  autorequire:
9
16
  bindir: bin
10
- cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
17
+ cert_chain:
18
+ - |
19
+ -----BEGIN CERTIFICATE-----
20
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
21
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
22
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
23
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
24
+ MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
25
+ bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
26
+ igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
27
+ 9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
28
+ sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
29
+ e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
30
+ XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
31
+ RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
32
+ tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
33
+ zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
34
+ xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
35
+ BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
36
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
37
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
38
+ cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
39
+ xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
40
+ c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
41
+ 8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
42
+ JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
43
+ eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
44
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
45
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
46
+ -----END CERTIFICATE-----
47
+ date: 2023-04-25 00:00:00.000000000 Z
12
48
  dependencies:
13
49
  - !ruby/object:Gem::Dependency
14
50
  name: async-http
@@ -104,9 +140,10 @@ files:
104
140
  - lib/.DS_Store
105
141
  - lib/async/http/faraday.rb
106
142
  - lib/async/http/faraday/adapter.rb
107
- - lib/async/http/faraday/agent.rb
108
143
  - lib/async/http/faraday/default.rb
109
144
  - lib/async/http/faraday/version.rb
145
+ - license.md
146
+ - readme.md
110
147
  homepage: https://github.com/socketry/async-http
111
148
  licenses:
112
149
  - MIT
@@ -126,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
163
  - !ruby/object:Gem::Version
127
164
  version: '0'
128
165
  requirements: []
129
- rubygems_version: 3.2.15
166
+ rubygems_version: 3.4.10
130
167
  signing_key:
131
168
  specification_version: 4
132
169
  summary: Provides an adaptor between async-http and faraday.
metadata.gz.sig ADDED
@@ -0,0 +1,5 @@
1
+ R�����W��Sa���K��@2� 4*�Rۂ��魴l�~���lO|��F쿊� s�'U�Xh�|uQ��_F��P��#��e��R`�w��u�'M��a�� �mʯ�b:uH��}���� sa����H^
2
+ ؗY��\Iq�Y:<X��� �Ɣ���w�2���8
3
+ _z-�·�5Y :�J^k�p�K�Z�fL���{��&؂j��=7��)'>��v'���%��Fc|�,es�u���rşVyw��EO� ��P:)�1��-�}��1�Ξ�Q�$�
4
+ A��"��`C��܁HZ �*ƊW�� E��RY
5
+ �H���zz�g��N�1�4���
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
-
23
- begin
24
- require 'sawyer/agent'
25
-
26
- # This is a nasty hack until https://github.com/lostisland/sawyer/pull/67 is resolved:
27
- unless Sawyer::Agent.instance_methods.include?(:close)
28
- class Sawyer::Agent
29
- def close
30
- @conn.close if @conn.respond_to?(:close)
31
- end
32
- end
33
- end
34
- rescue LoadError
35
- # Ignore.
36
- end