async-http 0.34.0 → 0.34.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/http/body/reader.rb +6 -4
- data/lib/async/http/internet.rb +4 -0
- data/lib/async/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aa49b687eb945cd14b93ae8f77eb75d0c225fe7b22fba5eb861e46893673388
|
4
|
+
data.tar.gz: e1f7785a689202683b11a84a01a6cc9a09ebefe52ebc77af935cb1e03f8fb171
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b64daffc3f2a30110f6b9d21d0db85917fb9c590f73cc8174fb9885821b92408d5abb904ae7574eefccd10fd6293ea74148416190f6b5dda6d15f751b9def36
|
7
|
+
data.tar.gz: c32f1e620e59f385c84f76be707f2373b69df262f3d6b70e172fe007e49a90d7a0f16ac9e8cb34839720b6b5978f35386cf48b7dc3d71dacf0ff350a02fa6ae4
|
@@ -55,10 +55,12 @@ module Async
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Write the body of the response to the given file path.
|
58
|
-
def save(path, mode = ::File::WRONLY, *args)
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
def save(path, mode = ::File::WRONLY|::File::CREAT, *args)
|
59
|
+
if @body
|
60
|
+
::File.open(path, mode, *args) do |file|
|
61
|
+
self.each do |chunk|
|
62
|
+
file.write(chunk)
|
63
|
+
end
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
data/lib/async/http/internet.rb
CHANGED
@@ -18,8 +18,10 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
|
+
require_relative 'client'
|
21
22
|
require_relative 'url_endpoint'
|
22
23
|
require_relative 'middleware'
|
24
|
+
require_relative 'body/buffered'
|
23
25
|
|
24
26
|
module Async
|
25
27
|
module HTTP
|
@@ -35,6 +37,8 @@ module Async
|
|
35
37
|
@clients[endpoint] = Client.new(endpoint)
|
36
38
|
end
|
37
39
|
|
40
|
+
body = Body::Buffered.wrap(body)
|
41
|
+
|
38
42
|
request = Request.new(endpoint.authority, method, endpoint.path, nil, headers, body)
|
39
43
|
|
40
44
|
return client.call(request)
|
data/lib/async/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.34.
|
4
|
+
version: 0.34.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|