protocol-http 0.27.0 → 0.28.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: a38b2bf9deae253c76d1bfeb0b980cc9ea833ce61c2e2b7ecc890ab951c852fe
4
- data.tar.gz: de7d4603e6e944e5d05f9b31fe17b4374837128ef6cca687630c7e97fb1ba5f7
3
+ metadata.gz: a890dc1781e2ea174d0f534394aa9f22fe4324b8bdffca39960e3e6d74f555aa
4
+ data.tar.gz: 44d2ff083bce62bd4f33c3310734b09565abda466c976cb84b92c984c25b9642
5
5
  SHA512:
6
- metadata.gz: ad5ea5d1e217f3284560d9b3f3114314618ab3ab330c4717bb374eabd51e5a46fb8ab810f04092cb8a7018a3c102da6d752121a3f4a5ef8fc9ae0b131939c38d
7
- data.tar.gz: 63aeea268ae41d87eb6ff8faea81c5db21c6bcda9da8fedf0d583d045cec1e8fea7a64d065096f52b28019998c0a73d4b642dc3537734d2fa986075e6ea55cca
6
+ metadata.gz: 00cfd9adcdd9cf55455bc0e87a1729b721d7db85b858d83f3695e160c8541c76b719ed0d2d2f9b04eb458cc1d4b829a8e9f075cf4eab39275081b29152d28b3c
7
+ data.tar.gz: b01e10053404dfa78f2d20ed6fa9fd320623efc2b3fe255ad30864153207d00ba58b0b829898c7f7b900a7506ec7ad0126b1aefc4da22a9811ed23401f6e6e73
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 [Reader] itself.
45
+ def buffered!
46
+ if @body
47
+ @body = @body.finish
48
+ end
49
+
50
+ return self
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.1"
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.1
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