async-http-faraday 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/async/http/faraday/adapter.rb +6 -3
- data/lib/async/http/faraday/version.rb +1 -1
- data/readme.md +3 -3
- data.tar.gz.sig +0 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab350ea82e4b97a4a08fa814825287e4ce92d327ce936d76fb15285b8eab39b3
|
4
|
+
data.tar.gz: '0651593c2937bddd8ebece312db4d4688111bc7029f61c71da814bd5866e3a5d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bff7ca5a8e0c5305e6d9fb75975fad4e5db34cc45546d37f5fdd4390148e7a310795d1bfe87ba164fc5d6149c3bb1df45c7b364ed2111f833d2954ae7045a5b3
|
7
|
+
data.tar.gz: ad8f7440d7760644437cff607b08c614bd6f2bd0c8ae02f6fdbb8f12c8ff5b9b5641ffa5fca69b5417e3902b0a28badd7eead77d20658e5b5fceb395d97883c7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/.DS_Store
ADDED
Binary file
|
@@ -18,7 +18,7 @@ require 'async/http/proxy'
|
|
18
18
|
module Async
|
19
19
|
module HTTP
|
20
20
|
module Faraday
|
21
|
-
class
|
21
|
+
class BodyReadWrapper < ::Protocol::HTTP::Body::Readable
|
22
22
|
def initialize(body, block_size: 4096)
|
23
23
|
@body = body
|
24
24
|
@block_size = block_size
|
@@ -118,8 +118,11 @@ module Async
|
|
118
118
|
if body = env.body
|
119
119
|
# We need to wrap the body in a Readable object so that it can be read in chunks:
|
120
120
|
# Faraday's body only responds to `#read`.
|
121
|
-
|
122
|
-
|
121
|
+
if body.respond_to?(:read)
|
122
|
+
body = BodyReadWrapper.new(body)
|
123
|
+
else
|
124
|
+
body = ::Protocol::HTTP::Body::Buffered.wrap(body)
|
125
|
+
end
|
123
126
|
end
|
124
127
|
|
125
128
|
if headers = env.request_headers
|
data/readme.md
CHANGED
@@ -31,8 +31,8 @@ require 'async/http/faraday'
|
|
31
31
|
Faraday.default_adapter = :async_http
|
32
32
|
|
33
33
|
# Per connection:
|
34
|
-
|
35
|
-
|
34
|
+
connection = Faraday.new(...) do |builder|
|
35
|
+
builder.adapter :async_http
|
36
36
|
end
|
37
37
|
```
|
38
38
|
|
@@ -40,7 +40,7 @@ Here is how you make a request:
|
|
40
40
|
|
41
41
|
``` ruby
|
42
42
|
Async do
|
43
|
-
response =
|
43
|
+
response = connection.get("/index")
|
44
44
|
end
|
45
45
|
```
|
46
46
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http-faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -44,7 +44,7 @@ cert_chain:
|
|
44
44
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
45
45
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date: 2024-02-
|
47
|
+
date: 2024-02-08 00:00:00.000000000 Z
|
48
48
|
dependencies:
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: async-http
|
@@ -81,6 +81,7 @@ extensions: []
|
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
83
|
- examples/topics.rb
|
84
|
+
- lib/.DS_Store
|
84
85
|
- lib/async/http/faraday.rb
|
85
86
|
- lib/async/http/faraday/adapter.rb
|
86
87
|
- lib/async/http/faraday/default.rb
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
107
|
- !ruby/object:Gem::Version
|
107
108
|
version: '0'
|
108
109
|
requirements: []
|
109
|
-
rubygems_version: 3.5.
|
110
|
+
rubygems_version: 3.5.5
|
110
111
|
signing_key:
|
111
112
|
specification_version: 4
|
112
113
|
summary: Provides an adaptor between async-http and faraday.
|
metadata.gz.sig
CHANGED
Binary file
|