io-stream 0.12.0 → 0.13.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/io/stream/duplex.rb +13 -0
- data/lib/io/stream/version.rb +1 -1
- data/lib/io/stream.rb +0 -12
- data/readme.md +4 -5
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: 19adcce8b9c2b4ab09e119675d2df7f030bb2a25b38774701e120bc8a75e2275
|
|
4
|
+
data.tar.gz: 942defa1b08a973b860d20d84a411317433f04eb8361c32c9b1b87f7bed16686
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7971599b56a27229f68d57b1907ca008c41041e38eb02285accd9f5d149ed5aa177d2e3eb9a1ea947dc8bab7d72ba8ba83ae59a53790d978d23c082d243d2789
|
|
7
|
+
data.tar.gz: 43c37664380b989b04183a033184d5b7f2443c83160e88d2edd6628edbbe5192ca3ba2de876560496622be0335882025b86ab9e13722e3eeb0906b541414ec6a
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/io/stream/duplex.rb
CHANGED
|
@@ -106,4 +106,17 @@ module IO::Stream
|
|
|
106
106
|
@output.wait_writable(duration)
|
|
107
107
|
end
|
|
108
108
|
end
|
|
109
|
+
|
|
110
|
+
# Construct a buffered stream from either one duplex IO-like object or two separate endpoints.
|
|
111
|
+
# @parameter input [IO] The duplex IO object, or the readable endpoint.
|
|
112
|
+
# @parameter output [IO | Nil] The writable endpoint, when distinct from the readable endpoint.
|
|
113
|
+
# @parameter options [Hash] Additional options passed to the buffered stream wrapper.
|
|
114
|
+
# @returns [IO::Stream::Buffered] A buffered stream wrapping the supplied transport.
|
|
115
|
+
def self.Duplex(input, output = nil, **options)
|
|
116
|
+
if output
|
|
117
|
+
Buffered.wrap(Duplex.new(input, output), **options)
|
|
118
|
+
else
|
|
119
|
+
::IO.Stream(input)
|
|
120
|
+
end
|
|
121
|
+
end
|
|
109
122
|
end
|
data/lib/io/stream/version.rb
CHANGED
data/lib/io/stream.rb
CHANGED
|
@@ -9,18 +9,6 @@ require_relative "stream/duplex"
|
|
|
9
9
|
|
|
10
10
|
# @namespace
|
|
11
11
|
class IO
|
|
12
|
-
# @namespace
|
|
13
|
-
module Stream
|
|
14
|
-
# Construct a buffered duplex stream from separate input and output endpoints.
|
|
15
|
-
# @parameter input [IO] The readable endpoint.
|
|
16
|
-
# @parameter output [IO] The writable endpoint.
|
|
17
|
-
# @parameter options [Hash] Additional options passed to the buffered stream wrapper.
|
|
18
|
-
# @returns [IO::Stream::Buffered] A buffered stream wrapping a duplex transport.
|
|
19
|
-
def self.Duplex(input, output = input, **options)
|
|
20
|
-
Buffered.wrap(Duplex.new(input, output), **options)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
12
|
# Convert any IO-like object into a buffered stream.
|
|
25
13
|
# @parameter io [IO] The IO object to wrap.
|
|
26
14
|
# @returns [IO::Stream::Buffered] A buffered stream wrapper.
|
data/readme.md
CHANGED
|
@@ -22,6 +22,10 @@ Please see the [project documentation](https://socketry.github.io/io-stream/) fo
|
|
|
22
22
|
|
|
23
23
|
Please see the [project releases](https://socketry.github.io/io-stream/releases/index) for all releases.
|
|
24
24
|
|
|
25
|
+
### v0.13.0
|
|
26
|
+
|
|
27
|
+
- `IO::Stream::Duplex(io)` is equivalent to `IO::Stream(io)`.
|
|
28
|
+
|
|
25
29
|
### v0.12.0
|
|
26
30
|
|
|
27
31
|
- Introduce `IO::Stream::Duplex` as a low-level duplex transport for composing separate input and output endpoints.
|
|
@@ -65,11 +69,6 @@ Please see the [project releases](https://socketry.github.io/io-stream/releases/
|
|
|
65
69
|
|
|
66
70
|
- Improve compatibility of `gets` implementation to better match Ruby's IO\#gets behavior.
|
|
67
71
|
|
|
68
|
-
### v0.5.0
|
|
69
|
-
|
|
70
|
-
- Add support for `read_until(limit:)` parameter to limit the amount of data read.
|
|
71
|
-
- Minor documentation improvements.
|
|
72
|
-
|
|
73
72
|
## See Also
|
|
74
73
|
|
|
75
74
|
- [async-io](https://github.com/socketry/async-io) — Where this implementation originally came from.
|
data/releases.md
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|