io-stream 0.12.0 → 0.13.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: 2c6d9477b767c150a9cf33bc11f6889f33a15a86da4814bdd90bc57eba91d47c
4
- data.tar.gz: fc9981e2657df9a82471e2d80de424c87186d64f356a6a06966d2723d137ae4e
3
+ metadata.gz: e0f15639c48eaed15b3b0f4bad4ecb93bb1403da1661dabc0aa5b583d079afe9
4
+ data.tar.gz: 56cdfe0066d7b9210b44de6726bee69c7801708fd4f6ea54081f347dc861028e
5
5
  SHA512:
6
- metadata.gz: a20fee7d1e21a51b8604502f7e90b90acfd46131fcde7f33639f9cdeccd570de733a64d0d7290beb1625857c9531242c37f45d673add9bc41444f5d424290dab
7
- data.tar.gz: 3f78ca242a41714a6b3768b593b44c63669b50a72be93a7e9ad0eab6e2e0eaa5c9a80d914f36894f3cd3cd8e6fc4f845c9f2ca2d14762754016bd071542bae5b
6
+ metadata.gz: 81b017d087c8cc2b75a72ea9fcb5fbc496ee8cf44212b23780379fe09768b7f22be7fd2b06ed4cf18aea447974473cccbc90f151d9bc8c7e5241bac79b88567e
7
+ data.tar.gz: b731554bf0ede37ec4547c5281b05be3c628dc5867a8a362a981f006e15a0c12e803c7f3cc185562dc788c8da2c4e64f52eec842fd2fc283a0169fdf5f620043
checksums.yaml.gz.sig CHANGED
Binary file
@@ -96,15 +96,8 @@ module IO::Stream
96
96
 
97
97
  protected
98
98
 
99
- if RUBY_VERSION < "3.3.6"
100
- def sysclose
101
- # https://bugs.ruby-lang.org/issues/20723
102
- Thread.new{@io.close}.join
103
- end
104
- else
105
- def sysclose
106
- @io.close
107
- end
99
+ def sysclose
100
+ @io.close
108
101
  end
109
102
 
110
103
  def syswrite(buffer)
@@ -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
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023-2025, by Samuel Williams.
4
+ # Copyright, 2023-2026, by Samuel Williams.
5
5
 
6
6
  module IO::Stream
7
- VERSION = "0.12.0"
7
+ VERSION = "0.13.1"
8
8
  end
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,14 @@ 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.1
26
+
27
+ - Set minimum Ruby verison to 3.3.6 to avoid hanging `close` issue in older Ruby versions.
28
+
29
+ ### v0.13.0
30
+
31
+ - `IO::Stream::Duplex(io)` is equivalent to `IO::Stream(io)`.
32
+
25
33
  ### v0.12.0
26
34
 
27
35
  - Introduce `IO::Stream::Duplex` as a low-level duplex transport for composing separate input and output endpoints.
@@ -61,15 +69,6 @@ Please see the [project releases](https://socketry.github.io/io-stream/releases/
61
69
 
62
70
  - Fix compatibility with Ruby v3.3.0 - v3.3.6 where broken `@io.close` could hang.
63
71
 
64
- ### v0.6.0
65
-
66
- - Improve compatibility of `gets` implementation to better match Ruby's IO\#gets behavior.
67
-
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
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.13.1
4
+
5
+ - Set minimum Ruby verison to 3.3.6 to avoid hanging `close` issue in older Ruby versions.
6
+
7
+ ## v0.13.0
8
+
9
+ - `IO::Stream::Duplex(io)` is equivalent to `IO::Stream(io)`.
10
+
3
11
  ## v0.12.0
4
12
 
5
13
  - Introduce `IO::Stream::Duplex` as a low-level duplex transport for composing separate input and output endpoints.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubygems_version: 4.0.6
84
+ rubygems_version: 4.0.10
85
85
  specification_version: 4
86
86
  summary: Provides a generic stream wrapper for IO instances.
87
87
  test_files: []
metadata.gz.sig CHANGED
Binary file