(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.
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.
* 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
* ext/strscan/strscan.c (strscan_aref): fix segfault after
get_byte or getch which do not apply regexp.
[ruby-core:82116] [Bug #13759]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
patched by Konstantin Haase [ruby-core:54664] [Feature #8343]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
dupped or frozen, because freezing it causes #concat method failure,
and unnecessary to dup without freezing. a patch from Aaron
Patterson at [ruby-core:25145].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
external local variable in the block parameters. [ruby-dev:32251]
* test/strscan/test_stringscanner.rb: avoid $KCODE, and use
String#force_encoding(). [ruby-dev:32251]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/strscan/strscan.c: new method StringScanner#beginning_of_line? (alias #bol?)
* ext/strscan/strscan.c: new method StringScanner#concat and #<<.
* ext/strscan/strscan.c: StringScanner#new(str) does not duplicate nor freeze STR (allow destructive modification).
* test/strscan/test_stringscanner.rb: test new methods above.
* test/strscan/test_stringscanner.rb: test destructive string modification.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e