async-http 0.34.0 → 0.34.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: 5db5986fab5adcee4d194355593dc340928348d58d47e3fa7bc871808a1df9f4
4
- data.tar.gz: f598d3fc50073ca60ff4f2a322317abc11ec54b08c71b1938448c7a661bdf787
3
+ metadata.gz: 1aa49b687eb945cd14b93ae8f77eb75d0c225fe7b22fba5eb861e46893673388
4
+ data.tar.gz: e1f7785a689202683b11a84a01a6cc9a09ebefe52ebc77af935cb1e03f8fb171
5
5
  SHA512:
6
- metadata.gz: '09bae9124371c5122da9410f95007d8acb1fa078cd829c31672bebb9eb1b81ee19238182d26a8b35b7e86e84335172ae85a444a7289c6361ad008a33fd906d43'
7
- data.tar.gz: ea2afa56fc284d1e6b591818837ed3a35fd7379fa975dfd83194e5f77503f55dbf5f73aa4695b77b9b15c082cdc2963827167474dda8539c09dac48a210c8d0d
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
- ::File.open(path, mode, *args) do |file|
60
- self.each do |chunk|
61
- file.write(chunk)
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
@@ -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)
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.34.0"
23
+ VERSION = "0.34.1"
24
24
  end
25
25
  end
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.0
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-17 00:00:00.000000000 Z
11
+ date: 2018-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async