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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http/body/reader.rb +14 -4
- data/lib/protocol/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4233cfc38541f0e482f7d006612dc04ae21b78da6f0950053dc664e8c195f111
|
4
|
+
data.tar.gz: '09849b7b28caf42edcc730e93047c87e8e1bdd7f53022d7a4295b89936b299f4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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
|
-
# @
|
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
|
-
# @
|
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
|
-
# @
|
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
|
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.
|
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-
|
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.
|
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
|