re2 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25e75b8fc36d93cae7cacd3d616749c766c4645cb960e86d2ebfceea2b283725
4
- data.tar.gz: c89bfd0da4f597573d34380daa74602911bc8c9dc279caac45eab80319b4e894
3
+ metadata.gz: 66760dea87bd17f60a5c30d337334629f603c0be67a5ec133ab3c0c81d5e6fb5
4
+ data.tar.gz: 77cef1bcb113505c2421b60de21fb1465c89b851d77ea7abe547f221001548b5
5
5
  SHA512:
6
- metadata.gz: 85202e0a6436dc4c9f88563242c42deb9df5f353bc1457115dd4f3ea3f41ce0d5c8a3c356477800bba866a79e61acdf13a8d88a9112f236e7d6f6e78f49d8f75
7
- data.tar.gz: c4f140f13b77200ca8f9ea4725a6e15bbe2794b4e55acde27d9e47b1b4f015ef9229f7328523234e67326824cf3a73632cc2196dbdd383dd4911944c969e3046
6
+ metadata.gz: 5de5904da1032cec75f79fd7db856e3e326ef89cc26a8e0416ba013459472557d2c6bb86cba7580f4091cb1738258a7a7b6c47b8c0e0790e35bafa54e48e8b69
7
+ data.tar.gz: 7a0c08a3b7e6e37d8337c17a42dca7a0619c2db5f97e71b53e6cf6c290d4f0907b91960b8f5e9d5567bd0f3180a8d5f5a4c8ba494022f4ecf427e721d621b226
data/README.md CHANGED
@@ -5,7 +5,7 @@ Ruby bindings to [RE2][], a "fast, safe, thread-friendly alternative to
5
5
  backtracking regular expression engines like those used in PCRE, Perl, and
6
6
  Python".
7
7
 
8
- **Current version:** 2.1.1
8
+ **Current version:** 2.1.2
9
9
  **Supported Ruby versions:** 2.6, 2.7, 3.0, 3.1, 3.2
10
10
  **Bundled RE2 version:** libre2.11 (2023-09-01)
11
11
  **Supported RE2 versions:** libre2.0 (< 2020-03-02), libre2.1 (2020-03-02), libre2.6 (2020-03-03), libre2.7 (2020-05-01), libre2.8 (2020-07-06), libre2.9 (2020-11-01), libre2.10 (2022-12-01), libre2.11 (2023-07-01)
@@ -262,7 +262,7 @@ Contributions
262
262
  the deprecation and removal of the `utf8` encoding option in RE2;
263
263
  * Thanks to [Sergio Medina](https://github.com/serch) for reporting a bug when
264
264
  using `RE2::Scanner#scan` with an invalid regular expression;
265
- * Thanks to [Pritam Baral](https://github.com/pritambaral) for contributed the
265
+ * Thanks to [Pritam Baral](https://github.com/pritambaral) for contributing the
266
266
  initial support for `RE2::Set`.
267
267
 
268
268
  Contact
data/ext/re2/re2.cc CHANGED
@@ -318,8 +318,9 @@ static re2::StringPiece *re2_matchdata_find_match(VALUE idx, const VALUE self) {
318
318
  } else {
319
319
  const char *name = SYMBOL_P(idx) ? rb_id2name(SYM2ID(idx)) : StringValuePtr(idx);
320
320
  const std::map<std::string, int>& groups = p->pattern->NamedCapturingGroups();
321
+ std::map<std::string, int>::const_iterator search = groups.find(name);
321
322
 
322
- if (std::map<std::string, int>::const_iterator search = groups.find(name); search != groups.end()) {
323
+ if (search != groups.end()) {
323
324
  id = search->second;
324
325
  } else {
325
326
  return NULL;
@@ -502,8 +503,9 @@ static VALUE re2_matchdata_named_match(const char* name, const VALUE self) {
502
503
  Data_Get_Struct(m->regexp, re2_pattern, p);
503
504
 
504
505
  const std::map<std::string, int>& groups = p->pattern->NamedCapturingGroups();
506
+ std::map<std::string, int>::const_iterator search = groups.find(name);
505
507
 
506
- if (std::map<std::string, int>::const_iterator search = groups.find(name); search != groups.end()) {
508
+ if (search != groups.end()) {
507
509
  return re2_matchdata_nth_match(search->second, self);
508
510
  } else {
509
511
  return Qnil;
@@ -719,8 +721,9 @@ static VALUE re2_matchdata_deconstruct_keys(const VALUE self, const VALUE keys)
719
721
  VALUE key = rb_ary_entry(keys, i);
720
722
  Check_Type(key, T_SYMBOL);
721
723
  const char *name = rb_id2name(SYM2ID(key));
724
+ std::map<std::string, int>::const_iterator search = groups.find(name);
722
725
 
723
- if (std::map<std::string, int>::const_iterator search = groups.find(name); search != groups.end()) {
726
+ if (search != groups.end()) {
724
727
  rb_hash_aset(capturing_groups, key, re2_matchdata_nth_match(search->second, self));
725
728
  } else {
726
729
  break;
data/lib/re2/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RE2
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: re2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Mucur
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-18 00:00:00.000000000 Z
12
+ date: 2023-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler