async-http-faraday 0.13.0 → 0.13.1

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: f29979ba18e04a42d3d6e1f3f9c526ad317855469b29c0a558f5a44a9fc71ad9
4
- data.tar.gz: 6f2fdb360239562744b4cfda02b149d02320db6f739b9295c9e255741b33b921
3
+ metadata.gz: ab350ea82e4b97a4a08fa814825287e4ce92d327ce936d76fb15285b8eab39b3
4
+ data.tar.gz: '0651593c2937bddd8ebece312db4d4688111bc7029f61c71da814bd5866e3a5d'
5
5
  SHA512:
6
- metadata.gz: 52cf7f3d635dfe2aeb1dfba9d0368cc080378e5481db807ff55764563f74cb5cf42adb1745d9543c64871043e645282826e3940128bf6df7c00460d7a0ec6478
7
- data.tar.gz: 9e24af568c3f181b3ac25076bac2d5285ac6ece909e095e9763207755244ffc068a80ec1705bc4ede81442dd3c7d232ae7f3a079c5f8ea9fb40d7aa6263c8f34
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 BodyWrapper < ::Protocol::HTTP::Body::Readable
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
- # body = ::Protocol::HTTP::Body::Buffered.wrap(body)
122
- body = BodyWrapper.new(body)
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
@@ -6,7 +6,7 @@
6
6
  module Async
7
7
  module HTTP
8
8
  module Faraday
9
- VERSION = "0.13.0"
9
+ VERSION = "0.13.1"
10
10
  end
11
11
  end
12
12
  end
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
- conn = Faraday.new(...) do |faraday|
35
- faraday.adapter :async_http
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 = conn.get("/index")
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.0
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-07 00:00:00.000000000 Z
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.3
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