<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/strscan, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/strscan] Deprecate constant `Id`</title>
<updated>2025-11-05T07:17:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-11-05T05:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=439ca0432e669f7cc4f884bcbafeef53aa948b93'/>
<id>439ca0432e669f7cc4f884bcbafeef53aa948b93</id>
<content type='text'>
`$Id$` is for RCS, CVS, and SVN; no information with GIT.

https://github.com/ruby/strscan/commit/9e3db14fa2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`$Id$` is for RCS, CVS, and SVN; no information with GIT.

https://github.com/ruby/strscan/commit/9e3db14fa2
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Deprecate undocumented toplevel constant `ScanError`</title>
<updated>2025-11-05T05:13:20+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-11-05T03:07:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f8e9bccd03f3e62e2f25cc08d5d5c6861347a0fe'/>
<id>f8e9bccd03f3e62e2f25cc08d5d5c6861347a0fe</id>
<content type='text'>
https://github.com/ruby/strscan/commit/b4ddc3a2a6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/strscan/commit/b4ddc3a2a6
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Support `Ractor#value`</title>
<updated>2025-06-03T09:13:15+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-06-03T07:44:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=267d8a04b369bd40ba229ff17995d1c09c917afa'/>
<id>267d8a04b369bd40ba229ff17995d1c09c917afa</id>
<content type='text'>
(https://github.com/ruby/strscan/pull/157)

This is same as https://github.com/ruby/stringio/pull/134

---------

https://github.com/ruby/strscan/commit/141f9cf9b6

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

This is same as https://github.com/ruby/stringio/pull/134

---------

https://github.com/ruby/strscan/commit/141f9cf9b6

Co-authored-by: Koichi Sasada &lt;ko1@atdot.net&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/strscan] jruby: Check if len++ walked off the end</title>
<updated>2025-05-08T09:03:04+00:00</updated>
<author>
<name>Charles Oliver Nutter</name>
<email>headius@headius.com</email>
</author>
<published>2025-05-03T04:26:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8685a81e6a0bdf7b766af930ee0e05a28e07d69b'/>
<id>8685a81e6a0bdf7b766af930ee0e05a28e07d69b</id>
<content type='text'>
(https://github.com/ruby/strscan/pull/153)

Fix https://github.com/ruby/strscan/pull/152

CRuby can walk off the end because there's always a null byte. In JRuby,
the byte array is often (usually?) the exact size of the string. So we
need to check if len++ walked off the end.

This code was ported from a version by @byroot in
https://github.com/ruby/strscan/pull/127 but I missed adding this check
due to a lack of tests. A test is included for both "-" and "+" parsing.

https://github.com/ruby/strscan/commit/1abe4ca556
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/strscan/pull/153)

Fix https://github.com/ruby/strscan/pull/152

CRuby can walk off the end because there's always a null byte. In JRuby,
the byte array is often (usually?) the exact size of the string. So we
need to check if len++ walked off the end.

This code was ported from a version by @byroot in
https://github.com/ruby/strscan/pull/127 but I missed adding this check
due to a lack of tests. A test is included for both "-" and "+" parsing.

https://github.com/ruby/strscan/commit/1abe4ca556
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] jruby: Pass end index to byteListToInum</title>
<updated>2025-05-08T09:03:04+00:00</updated>
<author>
<name>Charles Oliver Nutter</name>
<email>headius@headius.com</email>
</author>
<published>2025-05-03T00:26:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5a0306f9c1cd3c60d8b4735565a8cd794eb20ca6'/>
<id>5a0306f9c1cd3c60d8b4735565a8cd794eb20ca6</id>
<content type='text'>
(https://github.com/ruby/strscan/pull/150)

These parse methods take begin and end indices, not begin and length. A
test is included.

Fixes https://github.com/jruby/jruby/issues/8823

https://github.com/ruby/strscan/commit/9690e39e73
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/strscan/pull/150)

These parse methods take begin and end indices, not begin and length. A
test is included.

Fixes https://github.com/jruby/jruby/issues/8823

https://github.com/ruby/strscan/commit/9690e39e73
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] named_captures: fix incompatibility with</title>
<updated>2025-05-02T00:52:38+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2025-04-28T22:17:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=af6d6b64eafc8f9353804cd8c8192a2afed0d6e5'/>
<id>af6d6b64eafc8f9353804cd8c8192a2afed0d6e5</id>
<content type='text'>
MatchData#named_captures
(https://github.com/ruby/strscan/pull/146)

Fix https://github.com/ruby/strscan/pull/145

`MatchData#named_captures` use the last matched value for each name.

Reported by Linus Sellberg. Thanks!!!

https://github.com/ruby/strscan/commit/a6086ea322
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MatchData#named_captures
(https://github.com/ruby/strscan/pull/146)

Fix https://github.com/ruby/strscan/pull/145

`MatchData#named_captures` use the last matched value for each name.

Reported by Linus Sellberg. Thanks!!!

https://github.com/ruby/strscan/commit/a6086ea322
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Enable tests passing on TruffleRuby</title>
<updated>2025-02-25T06:36:46+00:00</updated>
<author>
<name>Andrii Konchyn</name>
<email>andry.konchin@gmail.com</email>
</author>
<published>2025-02-24T21:03:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ea8b0017b25e283c603ab84055b7c7db3a26f560'/>
<id>ea8b0017b25e283c603ab84055b7c7db3a26f560</id>
<content type='text'>
(https://github.com/ruby/strscan/pull/144)

Changes:
- enabled tests passing on TruffleRuby
- removed `truffleruby` and keep only `truffleruby-head` in CI

https://github.com/ruby/strscan/commit/4aadfc8408
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/strscan/pull/144)

Changes:
- enabled tests passing on TruffleRuby
- removed `truffleruby` and keep only `truffleruby-head` in CI

https://github.com/ruby/strscan/commit/4aadfc8408
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Fix a bug that inconsistency of IndexError vs nil for</title>
<updated>2025-02-25T06:36:46+00:00</updated>
<author>
<name>NAITOH Jun</name>
<email>naitoh@gmail.com</email>
</author>
<published>2025-02-23T07:52:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=018943ba0557cb78d429caf4a6d536faa94a95ca'/>
<id>018943ba0557cb78d429caf4a6d536faa94a95ca</id>
<content type='text'>
unknown capture group
(https://github.com/ruby/strscan/pull/143)

Fix https://github.com/ruby/strscan/pull/139

Reported by Benoit Daloze. Thanks!!!

https://github.com/ruby/strscan/commit/bc8a0d2623
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unknown capture group
(https://github.com/ruby/strscan/pull/143)

Fix https://github.com/ruby/strscan/pull/139

Reported by Benoit Daloze. Thanks!!!

https://github.com/ruby/strscan/commit/bc8a0d2623
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Fix a bug that scanning methods that don't use Regexp</title>
<updated>2025-02-25T06:36:46+00:00</updated>
<author>
<name>NAITOH Jun</name>
<email>naitoh@gmail.com</email>
</author>
<published>2025-02-23T01:21:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=36ab247e4d2fa7fa82142d9f70b340b28da05274'/>
<id>36ab247e4d2fa7fa82142d9f70b340b28da05274</id>
<content type='text'>
don't clear named capture groups
(https://github.com/ruby/strscan/pull/142)

Fix https://github.com/ruby/strscan/pull/135

https://github.com/ruby/strscan/commit/b957443e20
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
don't clear named capture groups
(https://github.com/ruby/strscan/pull/142)

Fix https://github.com/ruby/strscan/pull/135

https://github.com/ruby/strscan/commit/b957443e20
</pre>
</div>
</content>
</entry>
</feed>
