<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/stringio, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/stringio] Suppress warnings against pattern matching on ruby 2.7</title>
<updated>2025-11-10T04:10:10+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-11-10T04:03:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=28f760bf70085d97bab62c29e13c69c5a732e758'/>
<id>28f760bf70085d97bab62c29e13c69c5a732e758</id>
<content type='text'>
https://github.com/ruby/stringio/commit/cf58a203eb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/stringio/commit/cf58a203eb
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] fix: (jruby) failing to clean buffer's code-range</title>
<updated>2025-11-04T18:54:15+00:00</updated>
<author>
<name>kares</name>
<email>self@kares.org</email>
</author>
<published>2025-10-27T10:59:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=480080b5bf8a8c262b65469348836555955a5852'/>
<id>480080b5bf8a8c262b65469348836555955a5852</id>
<content type='text'>
same bug as: https://github.com/jruby/jruby/issues/9035

https://github.com/ruby/stringio/commit/65b144b175
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
same bug as: https://github.com/jruby/jruby/issues/9035

https://github.com/ruby/stringio/commit/65b144b175
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Fix test name</title>
<updated>2025-08-12T01:16:46+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2025-08-12T01:16:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f2c7968a4295bdfd658501a2071bcc165eb3423d'/>
<id>f2c7968a4295bdfd658501a2071bcc165eb3423d</id>
<content type='text'>
(https://github.com/ruby/stringio/pull/139)

https://github.com/ruby/stringio/commit/0edc8e22da
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/stringio/pull/139)

https://github.com/ruby/stringio/commit/0edc8e22da
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Fix SEGV at eof? on null StringIO</title>
<updated>2025-08-09T11:12:48+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-08-09T10:45:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b4d5ebcd12418642dec9f1e2e73ac87495666262'/>
<id>b4d5ebcd12418642dec9f1e2e73ac87495666262</id>
<content type='text'>
https://github.com/ruby/stringio/commit/29b9133332
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/stringio/commit/29b9133332
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Fix SEGV at read/pread on null StringIO</title>
<updated>2025-08-09T11:12:48+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-08-09T10:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=31f2d8990dcebf84cbbd3fedf838babaa59554a3'/>
<id>31f2d8990dcebf84cbbd3fedf838babaa59554a3</id>
<content type='text'>
https://github.com/ruby/stringio/commit/113dd5a55e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/stringio/commit/113dd5a55e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] fix: prevent segfault in StringIO#seek with SEEK_END</title>
<updated>2025-08-09T09:30:27+00:00</updated>
<author>
<name>koh-sh</name>
<email>34917718+koh-sh@users.noreply.github.com</email>
</author>
<published>2025-08-09T09:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=23c0113932407abccddbc6ee5b297d38d2d2bb9c'/>
<id>23c0113932407abccddbc6ee5b297d38d2d2bb9c</id>
<content type='text'>
on null device
(https://github.com/ruby/stringio/pull/137)

Fixes segmentation fault when calling `seek` with `SEEK_END` on null
device StringIO created by
  `StringIO.new(nil)`.

```bash
ruby -e "require 'stringio'; StringIO.new(nil).seek(0, IO::SEEK_END)"
```

I tested with below versions.

```bash
[koh@Kohs-MacBook-Pro] ~
% ruby -v;gem info stringio;sw_vers
ruby 3.4.5 (2025-07-16 revision https://github.com/ruby/stringio/commit/20cda200d3) +PRISM [arm64-darwin24]

*** LOCAL GEMS ***

stringio (3.1.2)
    Authors: Nobu Nakada, Charles Oliver Nutter
    Homepage: https://github.com/ruby/stringio
    Licenses: Ruby, BSD-2-Clause
    Installed at (default): /Users/koh/.local/share/mise/installs/ruby/3.4.5/lib/ruby/gems/3.4.0

    Pseudo IO on String
ProductName:            macOS
ProductVersion:         15.5
BuildVersion:           24F74
[koh@Kohs-MacBook-Pro] ~
%
```

https://github.com/ruby/stringio/commit/9399747bf9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
on null device
(https://github.com/ruby/stringio/pull/137)

Fixes segmentation fault when calling `seek` with `SEEK_END` on null
device StringIO created by
  `StringIO.new(nil)`.

```bash
ruby -e "require 'stringio'; StringIO.new(nil).seek(0, IO::SEEK_END)"
```

I tested with below versions.

```bash
[koh@Kohs-MacBook-Pro] ~
% ruby -v;gem info stringio;sw_vers
ruby 3.4.5 (2025-07-16 revision https://github.com/ruby/stringio/commit/20cda200d3) +PRISM [arm64-darwin24]

*** LOCAL GEMS ***

stringio (3.1.2)
    Authors: Nobu Nakada, Charles Oliver Nutter
    Homepage: https://github.com/ruby/stringio
    Licenses: Ruby, BSD-2-Clause
    Installed at (default): /Users/koh/.local/share/mise/installs/ruby/3.4.5/lib/ruby/gems/3.4.0

    Pseudo IO on String
ProductName:            macOS
ProductVersion:         15.5
BuildVersion:           24F74
[koh@Kohs-MacBook-Pro] ~
%
```

https://github.com/ruby/stringio/commit/9399747bf9
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Support `Ractor#value`</title>
<updated>2025-06-03T07:44:36+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-06-03T07:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7d1190059fa872f1a6c2f51fde8c1971b8c2bcaf'/>
<id>7d1190059fa872f1a6c2f51fde8c1971b8c2bcaf</id>
<content type='text'>
(https://github.com/ruby/stringio/pull/134)

from https://bugs.ruby-lang.org/issues/21262

We need to alias `Ractor#value` to `Ractor#take` for old versions of
Ruby.

---------

https://github.com/ruby/stringio/commit/9954dabd80

Co-authored-by: Koichi Sasada &lt;ko1@atdot.net&gt;
Co-authored-by: Sutou Kouhei &lt;kou@clear-code.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/stringio/pull/134)

from https://bugs.ruby-lang.org/issues/21262

We need to alias `Ractor#value` to `Ractor#take` for old versions of
Ruby.

---------

https://github.com/ruby/stringio/commit/9954dabd80

Co-authored-by: Koichi Sasada &lt;ko1@atdot.net&gt;
Co-authored-by: Sutou Kouhei &lt;kou@clear-code.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>`Ractor::Port`</title>
<updated>2025-05-30T19:01:33+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-05-26T18:58:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ef2bb61018cd9ccb5b61a3d91911e04a773da4a7'/>
<id>ef2bb61018cd9ccb5b61a3d91911e04a773da4a7</id>
<content type='text'>
* Added `Ractor::Port`
  * `Ractor::Port#receive` (support multi-threads)
  * `Rcator::Port#close`
  * `Ractor::Port#closed?`
* Added some methods
  * `Ractor#join`
  * `Ractor#value`
  * `Ractor#monitor`
  * `Ractor#unmonitor`
* Removed some methods
  * `Ractor#take`
  * `Ractor.yield`
* Change the spec
  * `Racotr.select`

You can wait for multiple sequences of messages with `Ractor::Port`.

```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
  Ractor.new port,ri do |port, ri|
    3.times{|i| port &lt;&lt; "r#{ri}-#{i}"}
  end
end

p ports.each{|port| pp 3.times.map{port.receive}}

```

In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.

You can use `Ractor#value` to get the last value of a Ractor's block:

```ruby
result = Ractor.new do
  heavy_task()
end.value
```

You can wait for the termination of a Ractor with `Ractor#join` like this:

```ruby
Ractor.new do
  some_task()
end.join
```

`#value` and `#join` are similar to `Thread#value` and `Thread#join`.

To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.

This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.

We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.

We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
  This lock is released by `rb_ractor_sched_barrier_end()`
  which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.

https://bugs.ruby-lang.org/issues/21262
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Added `Ractor::Port`
  * `Ractor::Port#receive` (support multi-threads)
  * `Rcator::Port#close`
  * `Ractor::Port#closed?`
* Added some methods
  * `Ractor#join`
  * `Ractor#value`
  * `Ractor#monitor`
  * `Ractor#unmonitor`
* Removed some methods
  * `Ractor#take`
  * `Ractor.yield`
* Change the spec
  * `Racotr.select`

You can wait for multiple sequences of messages with `Ractor::Port`.

```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
  Ractor.new port,ri do |port, ri|
    3.times{|i| port &lt;&lt; "r#{ri}-#{i}"}
  end
end

p ports.each{|port| pp 3.times.map{port.receive}}

```

In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.

You can use `Ractor#value` to get the last value of a Ractor's block:

```ruby
result = Ractor.new do
  heavy_task()
end.value
```

You can wait for the termination of a Ractor with `Ractor#join` like this:

```ruby
Ractor.new do
  some_task()
end.join
```

`#value` and `#join` are similar to `Thread#value` and `Thread#join`.

To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.

This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.

We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.

We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
  This lock is released by `rb_ractor_sched_barrier_end()`
  which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.

https://bugs.ruby-lang.org/issues/21262
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Do not issue warning when calling set_encoding if string is chilled</title>
<updated>2025-05-13T03:20:09+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2025-04-15T01:51:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=18d395e0784401585b5c14300e689de55e208647'/>
<id>18d395e0784401585b5c14300e689de55e208647</id>
<content type='text'>
StringIO does not warn for unchilled unfrozen string or for frozen
string, so it should not warn for chilled string.

https://github.com/ruby/stringio/commit/4ac33b8c70
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
StringIO does not warn for unchilled unfrozen string or for frozen
string, so it should not warn for chilled string.

https://github.com/ruby/stringio/commit/4ac33b8c70
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/stringio] Fix SEGV at unget to a null device StringIO</title>
<updated>2025-02-21T12:06:19+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-02-21T10:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7ef9110b1eaefbcbf72f25ad941c2c3b7ed3db01'/>
<id>7ef9110b1eaefbcbf72f25ad941c2c3b7ed3db01</id>
<content type='text'>
https://github.com/ruby/stringio/commit/eb4ee49218
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/stringio/commit/eb4ee49218
</pre>
</div>
</content>
</entry>
</feed>
