protocol-http 0.27.0 → 0.28.0

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: a38b2bf9deae253c76d1bfeb0b980cc9ea833ce61c2e2b7ecc890ab951c852fe
4
- data.tar.gz: de7d4603e6e944e5d05f9b31fe17b4374837128ef6cca687630c7e97fb1ba5f7
3
+ metadata.gz: 4233cfc38541f0e482f7d006612dc04ae21b78da6f0950053dc664e8c195f111
4
+ data.tar.gz: '09849b7b28caf42edcc730e93047c87e8e1bdd7f53022d7a4295b89936b299f4'
5
5
  SHA512:
6
- metadata.gz: ad5ea5d1e217f3284560d9b3f3114314618ab3ab330c4717bb374eabd51e5a46fb8ab810f04092cb8a7018a3c102da6d752121a3f4a5ef8fc9ae0b131939c38d
7
- data.tar.gz: 63aeea268ae41d87eb6ff8faea81c5db21c6bcda9da8fedf0d583d045cec1e8fea7a64d065096f52b28019998c0a73d4b642dc3537734d2fa986075e6ea55cca
6
+ metadata.gz: 6f034458655ec357fa9713126017e799e4750fdf36ce92114b70cb6eb24191c5390495c1b8b70b1114abdde557ca1a8b55074178ed926979030eb526b6ea3b2f
7
+ data.tar.gz: 0d5d6d55398952e449d211ee589bf6ae59dbee661a1c08b702f4a6f445c3907c9838f0270aacc11851c2d393eb9edd58b69334577dc08c407f8b2948ba176aeb
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
  # Copyright, 2022, by Dan Olson.
6
6
 
7
7
  module Protocol
@@ -10,7 +10,7 @@ module Protocol
10
10
  # General operations for interacting with a request or response body.
11
11
  module Reader
12
12
  # Read chunks from the body.
13
- # @yield [String] read chunks from the body.
13
+ # @yields {|chunk| ...} chunks from the body.
14
14
  def each(&block)
15
15
  if @body
16
16
  @body.each(&block)
@@ -19,7 +19,7 @@ module Protocol
19
19
  end
20
20
 
21
21
  # Reads the entire request/response body.
22
- # @return [String] the entire body as a string.
22
+ # @returns [String] the entire body as a string.
23
23
  def read
24
24
  if @body
25
25
  buffer = @body.join
@@ -30,7 +30,7 @@ module Protocol
30
30
  end
31
31
 
32
32
  # Gracefully finish reading the body. This will buffer the remainder of the body.
33
- # @return [Buffered] buffers the entire body.
33
+ # @returns [Buffered] buffers the entire body.
34
34
  def finish
35
35
  if @body
36
36
  body = @body.finish
@@ -40,6 +40,16 @@ module Protocol
40
40
  end
41
41
  end
42
42
 
43
+ # Buffer the entire request/response body.
44
+ # @returns [Readable] the buffered body.
45
+ def buffered!
46
+ if @body
47
+ @body = @body.finish
48
+
49
+ return @body
50
+ end
51
+ end
52
+
43
53
  # Write the body of the response to the given file path.
44
54
  def save(path, mode = ::File::WRONLY|::File::CREAT|::File::TRUNC, **options)
45
55
  if @body
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.27.0"
8
+ VERSION = "0.28.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -47,7 +47,7 @@ cert_chain:
47
47
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
48
48
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
49
49
  -----END CERTIFICATE-----
50
- date: 2024-07-12 00:00:00.000000000 Z
50
+ date: 2024-07-19 00:00:00.000000000 Z
51
51
  dependencies: []
52
52
  description:
53
53
  email:
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.5.9
117
+ rubygems_version: 3.5.11
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Provides abstractions to handle HTTP protocols.
metadata.gz.sig CHANGED
Binary file