strscan 3.0.7 → 3.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/strscan/strscan.c +12 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b1aee872d83aeba4bed1ba048f074487816c3b50fbc872866eb015f16327166
|
4
|
+
data.tar.gz: 8a10e923df28f57169ccf191c14998fad8c41b857be6932b4b6a86815a5572fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c58130e6087c910bcdb412f866f000f191b1db15cc42121c1a95c88b78f4baf14776a45ea925f34cd7c6b5c503d8b16908f3cd5a311376bfd948314ac531932
|
7
|
+
data.tar.gz: f974920bfea3fb57b8b01e685c0338062a8bc4df4c29397ed61272864f4b4b623c243fe9fdf212a9e7afecf78a5d78fb87cca09858f77ac8abe1858f79542530
|
data/ext/strscan/strscan.c
CHANGED
@@ -22,7 +22,7 @@ extern size_t onig_region_memsize(const struct re_registers *regs);
|
|
22
22
|
|
23
23
|
#include <stdbool.h>
|
24
24
|
|
25
|
-
#define STRSCAN_VERSION "3.0.
|
25
|
+
#define STRSCAN_VERSION "3.0.9"
|
26
26
|
|
27
27
|
/* =======================================================================
|
28
28
|
Data Type Definitions
|
@@ -1243,10 +1243,10 @@ strscan_size(VALUE self)
|
|
1243
1243
|
* If nothing was priorly matched, it returns nil.
|
1244
1244
|
*
|
1245
1245
|
* s = StringScanner.new("Fri Dec 12 1975 14:39")
|
1246
|
-
* s.scan(/(\w+) (\w+) (\d+)
|
1247
|
-
* s.captures
|
1248
|
-
* s.scan(/(\w+) (\w+) (\d+)
|
1249
|
-
* s.captures
|
1246
|
+
* s.scan(/(\w+) (\w+) (\d+) (1980)?/) # -> "Fri Dec 12 "
|
1247
|
+
* s.captures # -> ["Fri", "Dec", "12", nil]
|
1248
|
+
* s.scan(/(\w+) (\w+) (\d+) (1980)?/) # -> nil
|
1249
|
+
* s.captures # -> nil
|
1250
1250
|
*/
|
1251
1251
|
static VALUE
|
1252
1252
|
strscan_captures(VALUE self)
|
@@ -1262,9 +1262,13 @@ strscan_captures(VALUE self)
|
|
1262
1262
|
new_ary = rb_ary_new2(num_regs);
|
1263
1263
|
|
1264
1264
|
for (i = 1; i < num_regs; i++) {
|
1265
|
-
VALUE str
|
1266
|
-
|
1267
|
-
|
1265
|
+
VALUE str;
|
1266
|
+
if (p->regs.beg[i] == -1)
|
1267
|
+
str = Qnil;
|
1268
|
+
else
|
1269
|
+
str = extract_range(p,
|
1270
|
+
adjust_register_position(p, p->regs.beg[i]),
|
1271
|
+
adjust_register_position(p, p->regs.end[i]));
|
1268
1272
|
rb_ary_push(new_ary, str);
|
1269
1273
|
}
|
1270
1274
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strscan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minero Aoki
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-01-21 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Provides lexical scanning operations on a String.
|
16
16
|
email:
|
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
requirements: []
|
49
|
-
rubygems_version: 3.3
|
49
|
+
rubygems_version: 3.5.3
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Provides lexical scanning operations on a String.
|