<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/strscan/test_stringscanner.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) f54369830f83a65fb54916d762883fbe6eeb7d0b, 338eb0065bd81ba8ae8b9402abc94804a24594cc, ac636f5709feb1d9d7a0c46a86be153be765cf21: [Backport #20516]</title>
<updated>2024-06-04T20:14:09+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-06-04T20:14:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1df1538be4a494bbc5ef6e3504312a0284948709'/>
<id>1df1538be4a494bbc5ef6e3504312a0284948709</id>
<content type='text'>
	Revert "Rollback to released version numbers of stringio and strscan"

	This reverts commit 6a79e53823e328281b9e9eee53cd141af28f8548.

	[ruby/strscan] StringScanner#captures: Return nil not "" for unmached capture (https://github.com/ruby/strscan/pull/72)

	fix https://github.com/ruby/strscan/issues/70
	If there is no substring matching the group (s[3]), the behavior is
	different.

	If there is no substring matching the group, the corresponding element
	(s[3]) should be nil.

	```
	s = StringScanner.new('foobarbaz') #=&gt; #&lt;StringScanner 0/9 @ "fooba..."&gt;
	s.scan /(foo)(bar)(BAZ)?/  #=&gt; "foobar"
	s[0]           #=&gt; "foobar"
	s[1]           #=&gt; "foo"
	s[2]           #=&gt; "bar"
	s[3]           #=&gt; nil
	s.captures #=&gt; ["foo", "bar", ""]
	s.captures.compact #=&gt; ["foo", "bar", ""]
	```

	```
	s = StringScanner.new('foobarbaz') #=&gt; #&lt;StringScanner 0/9 @ "fooba..."&gt;
	s.scan /(foo)(bar)(BAZ)?/  #=&gt; "foobar"
	s[0]           #=&gt; "foobar"
	s[1]           #=&gt; "foo"
	s[2]           #=&gt; "bar"
	s[3]           #=&gt; nil
	s.captures #=&gt; ["foo", "bar", nil]
	s.captures.compact #=&gt; ["foo", "bar"]
	```

	https://docs.ruby-lang.org/ja/latest/method/MatchData/i/captures.html
	```
	/(foo)(bar)(BAZ)?/ =~ "foobarbaz" #=&gt; 0
	$~.to_a        #=&gt; ["foobar", "foo", "bar", nil]
	$~.captures #=&gt; ["foo", "bar", nil]
	$~.captures.compact #=&gt; ["foo", "bar"]
	```

	* StringScanner#captures is not yet documented.
	https://docs.ruby-lang.org/ja/latest/class/StringScanner.html

	https://github.com/ruby/strscan/commit/1fbfdd3c6f

	[ruby/strscan] Bump version

	https://github.com/ruby/strscan/commit/d6f97ec102
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Revert "Rollback to released version numbers of stringio and strscan"

	This reverts commit 6a79e53823e328281b9e9eee53cd141af28f8548.

	[ruby/strscan] StringScanner#captures: Return nil not "" for unmached capture (https://github.com/ruby/strscan/pull/72)

	fix https://github.com/ruby/strscan/issues/70
	If there is no substring matching the group (s[3]), the behavior is
	different.

	If there is no substring matching the group, the corresponding element
	(s[3]) should be nil.

	```
	s = StringScanner.new('foobarbaz') #=&gt; #&lt;StringScanner 0/9 @ "fooba..."&gt;
	s.scan /(foo)(bar)(BAZ)?/  #=&gt; "foobar"
	s[0]           #=&gt; "foobar"
	s[1]           #=&gt; "foo"
	s[2]           #=&gt; "bar"
	s[3]           #=&gt; nil
	s.captures #=&gt; ["foo", "bar", ""]
	s.captures.compact #=&gt; ["foo", "bar", ""]
	```

	```
	s = StringScanner.new('foobarbaz') #=&gt; #&lt;StringScanner 0/9 @ "fooba..."&gt;
	s.scan /(foo)(bar)(BAZ)?/  #=&gt; "foobar"
	s[0]           #=&gt; "foobar"
	s[1]           #=&gt; "foo"
	s[2]           #=&gt; "bar"
	s[3]           #=&gt; nil
	s.captures #=&gt; ["foo", "bar", nil]
	s.captures.compact #=&gt; ["foo", "bar"]
	```

	https://docs.ruby-lang.org/ja/latest/method/MatchData/i/captures.html
	```
	/(foo)(bar)(BAZ)?/ =~ "foobarbaz" #=&gt; 0
	$~.to_a        #=&gt; ["foobar", "foo", "bar", nil]
	$~.captures #=&gt; ["foo", "bar", nil]
	$~.captures.compact #=&gt; ["foo", "bar"]
	```

	* StringScanner#captures is not yet documented.
	https://docs.ruby-lang.org/ja/latest/class/StringScanner.html

	https://github.com/ruby/strscan/commit/1fbfdd3c6f

	[ruby/strscan] Bump version

	https://github.com/ruby/strscan/commit/d6f97ec102
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Sync missed commit</title>
<updated>2023-07-27T13:42:42+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-07-27T13:42:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e27eab2f85f3d16a822b5c239d44d6fb34d72e5f'/>
<id>e27eab2f85f3d16a822b5c239d44d6fb34d72e5f</id>
<content type='text'>
Syncs commit ruby/strscan@76b377a5d875ec77282d9319d62d8f24fe283b40.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Syncs commit ruby/strscan@76b377a5d875ec77282d9319d62d8f24fe283b40.
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Mask out this test on JRuby/Windows</title>
<updated>2023-02-21T10:31:39+00:00</updated>
<author>
<name>Charles Oliver Nutter</name>
<email>headius@headius.com</email>
</author>
<published>2023-02-09T13:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4c7726516c2b3b54cd0a78a214f005881fc68aba'/>
<id>4c7726516c2b3b54cd0a78a214f005881fc68aba</id>
<content type='text'>
See https://github.com/jruby/jruby/issues/7644 for the root issue,
which will require fixes to JRuby's regular expression engine,
JOni.

https://github.com/ruby/strscan/commit/29a65abff2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://github.com/jruby/jruby/issues/7644 for the root issue,
which will require fixes to JRuby's regular expression engine,
JOni.

https://github.com/ruby/strscan/commit/29a65abff2
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] test: Run test more with fixed anchor mode</title>
<updated>2023-02-21T10:31:38+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@clear-code.com</email>
</author>
<published>2023-02-08T22:51:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=76a4cdfb0253532a9bfe08d39c07f783ded71e20'/>
<id>76a4cdfb0253532a9bfe08d39c07f783ded71e20</id>
<content type='text'>
(https://github.com/ruby/strscan/pull/60)

fix https://github.com/ruby/strscan/pull/56
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/strscan/pull/60)

fix https://github.com/ruby/strscan/pull/56
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Add test case to `test_string`</title>
<updated>2023-02-21T10:31:38+00:00</updated>
<author>
<name>OKURA Masafumi</name>
<email>masafumi.o1988@gmail.com</email>
</author>
<published>2023-02-08T20:46:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=260bc7cdfa8e7b718f24977e18f15a98d795acb0'/>
<id>260bc7cdfa8e7b718f24977e18f15a98d795acb0</id>
<content type='text'>
(https://github.com/ruby/strscan/pull/58)

`string` returns the original string after `scan` is called. Current
test doesn't check this behavior and now it's covered.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/strscan/pull/58)

`string` returns the original string after `scan` is called. Current
test doesn't check this behavior and now it's covered.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge strscan-3.0.5</title>
<updated>2022-12-09T07:36:22+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2022-12-09T04:03:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4e31fea77d360c6535e33ff2525d80fba38d15d8'/>
<id>4e31fea77d360c6535e33ff2525d80fba38d15d8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/strscan] Fix segmentation fault of `StringScanner#charpos` when `String#byteslice` returns non string value [Bug #17756] (#20)</title>
<updated>2021-05-06T07:20:38+00:00</updated>
<author>
<name>Kenichi Kamiya</name>
<email>kachick1@gmail.com</email>
</author>
<published>2021-03-31T05:56:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=564ccd095a9d7fbe869031dbf666d61dadfdcb03'/>
<id>564ccd095a9d7fbe869031dbf666d61dadfdcb03</id>
<content type='text'>
https://github.com/ruby/strscan/commit/92961cde2b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/strscan/commit/92961cde2b
</pre>
</div>
</content>
</entry>
<entry>
<title>Deprecate taint/trust and related methods, and make the methods no-ops</title>
<updated>2019-11-17T23:00:25+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-09-25T03:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ffd0820ab317542f8780aac475da590a4bdbc7a8'/>
<id>ffd0820ab317542f8780aac475da590a4bdbc7a8</id>
<content type='text'>
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
</pre>
</div>
</content>
</entry>
<entry>
<title>Import StringScanner 1.0.3 (#2553)</title>
<updated>2019-10-14T03:40:50+00:00</updated>
<author>
<name>Sutou Kouhei</name>
<email>kou@cozmixng.org</email>
</author>
<published>2019-10-14T03:40:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=95c420c4a65ca2e7f3edf27134ad33691959296c'/>
<id>95c420c4a65ca2e7f3edf27134ad33691959296c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>strscan.c: add MatchData-like methods</title>
<updated>2017-11-29T07:57:48+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-11-29T07:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=256c88861beb452d790d74c7677a7e4217bc170b'/>
<id>256c88861beb452d790d74c7677a7e4217bc170b</id>
<content type='text'>
* ext/strscan/strscan.c: added `size`, `captures` and `values_at`
  to StringScanner, shorthands of accessing the matched data.
  based on the patch by apeiros (Stefan Rusterholz) at
  [ruby-core:20412].  [Feature #836]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ext/strscan/strscan.c: added `size`, `captures` and `values_at`
  to StringScanner, shorthands of accessing the matched data.
  based on the patch by apeiros (Stefan Rusterholz) at
  [ruby-core:20412].  [Feature #836]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
