protocol-http 0.37.0 → 0.38.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/buffered.rb +8 -1
- data/lib/protocol/http/body/readable.rb +11 -2
- data/lib/protocol/http/body/wrapper.rb +4 -0
- data/lib/protocol/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: 95fdcce85b20ee97e54b44068d59f689f040d1c9489b0e2ff8f9e63464d4c7cd
|
4
|
+
data.tar.gz: a72f51087a046f2f713208baace1631414e32b1e2eceb82ff69d479b2c2a7eac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4e7504cf962c63a5dac26fbd235b50d6796d5c97eb1f4b40be4cf6023fd1e118a8c64254d1199cab94f1086ad608367e1e4932de1836d63986b2548149fb3b7
|
7
|
+
data.tar.gz: b88389e903b175e65fa9f1ee2e36b4894d0484475d8f999ab001cf4968c6edbafb1f9a75fbf14f7fad5f1c7d8e2b4b40a55fd2070aa19ac9eb0a4aae785fdbec
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -52,6 +52,13 @@ module Protocol
|
|
52
52
|
|
53
53
|
attr :chunks
|
54
54
|
|
55
|
+
# A rewindable body wraps some other body. Convert it to a buffered body. The buffered body will share the same chunks as the rewindable body.
|
56
|
+
#
|
57
|
+
# @returns [Buffered] the buffered body.
|
58
|
+
def buffered
|
59
|
+
self.class.new(@chunks)
|
60
|
+
end
|
61
|
+
|
55
62
|
def finish
|
56
63
|
self
|
57
64
|
end
|
@@ -64,7 +71,7 @@ module Protocol
|
|
64
71
|
end
|
65
72
|
|
66
73
|
def clear
|
67
|
-
@chunks
|
74
|
+
@chunks = []
|
68
75
|
@length = 0
|
69
76
|
@index = 0
|
70
77
|
end
|
@@ -11,9 +11,9 @@ module Protocol
|
|
11
11
|
#
|
12
12
|
# Typically, you'd override `#read` to return chunks of data.
|
13
13
|
#
|
14
|
-
#
|
14
|
+
# In general, you read chunks of data from a body until it is empty and returns `nil`. Upon reading `nil`, the body is considered consumed and should not be read from again.
|
15
15
|
#
|
16
|
-
# Reading can also fail, for example if the body represents a streaming upload, and the connection is lost. In this case,
|
16
|
+
# Reading can also fail, for example if the body represents a streaming upload, and the connection is lost. In this case, `#read` will raise some kind of error.
|
17
17
|
#
|
18
18
|
# If you don't want to read from a stream, and instead want to close it immediately, you can call `close` on the body. If the body is already completely consumed, `close` will do nothing, but if there is still data to be read, it will cause the underlying stream to be reset (and possibly closed).
|
19
19
|
class Readable
|
@@ -50,6 +50,15 @@ module Protocol
|
|
50
50
|
false
|
51
51
|
end
|
52
52
|
|
53
|
+
# Return a buffered representation of this body.
|
54
|
+
#
|
55
|
+
# This method must return a buffered body if `#rewindable?`.
|
56
|
+
#
|
57
|
+
# @returns [Buffered | Nil] The buffered body.
|
58
|
+
def buffered
|
59
|
+
nil
|
60
|
+
end
|
61
|
+
|
53
62
|
# The total length of the body, if known.
|
54
63
|
# @returns [Integer | Nil] The total length of the body, or `nil` if the length is unknown.
|
55
64
|
def length
|
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.38.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-
|
50
|
+
date: 2024-10-14 00:00:00.000000000 Z
|
51
51
|
dependencies: []
|
52
52
|
description:
|
53
53
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|