re2 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/Rakefile +1 -1
- data/dependencies.yml +4 -4
- data/ext/re2/extconf.rb +5 -10
- data/ext/re2/re2.cc +2 -14
- data/ext/re2/recipes.rb +3 -3
- data/lib/re2/version.rb +1 -1
- data/ports/archives/20250814.1.tar.gz +0 -0
- data/ports/archives/re2-2025-08-12.tar.gz +0 -0
- data/re2.gemspec +3 -3
- metadata +8 -8
- data/ports/archives/20250127.1.tar.gz +0 -0
- data/ports/archives/re2-2025-08-05.tar.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6dfe1e8936d2ed850d19d06b2282301fe3beba470bef188e8d1e1f535f851f3
|
4
|
+
data.tar.gz: 7b434ad6f5be1c042858cd2dfcf695d45b5036917503e0ab2bdf567fdc093731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ea034974f51a824c156668ce23bec6302e9cfd1ea5e8d49e602e73f89265d767595cec573dae9d410fcd808d405fa236583125dad7eee10ffd9a3770caf2511
|
7
|
+
data.tar.gz: fa1e9e4295be060dd9a2478ab5aa7c19071384da85467b5e2cf533e6a3e0f1c44149393e41ef705f3e357b3a6c7f1a634038ad796081974ced459108986f0301
|
data/README.md
CHANGED
@@ -6,8 +6,8 @@ Python".
|
|
6
6
|
|
7
7
|
[](https://github.com/mudge/re2/actions)
|
8
8
|
|
9
|
-
**Current version:** 2.
|
10
|
-
**Bundled RE2 version:** libre2.11 (2025-08-
|
9
|
+
**Current version:** 2.20.0
|
10
|
+
**Bundled RE2 version:** libre2.11 (2025-08-12)
|
11
11
|
|
12
12
|
```ruby
|
13
13
|
RE2('h.*o').full_match?("hello") #=> true
|
@@ -260,21 +260,21 @@ RE2(non_latin1_pattern.encode("ISO-8859-1"), utf8: false).match(non_latin1_text.
|
|
260
260
|
|
261
261
|
This gem requires the following to run:
|
262
262
|
|
263
|
-
* [Ruby](https://www.ruby-lang.org/en/)
|
263
|
+
* [Ruby](https://www.ruby-lang.org/en/) 3.1 to 3.4
|
264
264
|
|
265
265
|
It supports the following RE2 ABI versions:
|
266
266
|
|
267
|
-
* libre2.0 (prior to release 2020-03-02) to libre2.11 (2023-07-01 to 2025-08-
|
267
|
+
* libre2.0 (prior to release 2020-03-02) to libre2.11 (2023-07-01 to 2025-08-12)
|
268
268
|
|
269
269
|
### Native gems
|
270
270
|
|
271
271
|
Where possible, a pre-compiled native gem will be provided for the following platforms:
|
272
272
|
|
273
273
|
* Linux
|
274
|
-
* `aarch64-linux`, `arm-linux`,
|
274
|
+
* `aarch64-linux`, `arm-linux`, and `x86_64-linux` (requires [glibc](https://www.gnu.org/software/libc/) 2.29+, RubyGems 3.3.22+ and Bundler 2.3.21+)
|
275
275
|
* [musl](https://musl.libc.org/)-based systems such as [Alpine](https://alpinelinux.org) are supported with Bundler 2.5.6+
|
276
|
-
* macOS `x86_64-darwin` and `arm64-darwin`
|
277
|
-
* Windows
|
276
|
+
* macOS 10.14+ `x86_64-darwin` and `arm64-darwin`
|
277
|
+
* Windows 2022+ `x64-mingw-ucrt`
|
278
278
|
|
279
279
|
### Verifying the gems
|
280
280
|
|
@@ -331,8 +331,8 @@ You will need a full compiler toolchain for compiling Ruby C extensions (see
|
|
331
331
|
Toolchain"](https://nokogiri.org/tutorials/installing_nokogiri.html#appendix-a-the-compiler-toolchain))
|
332
332
|
plus the toolchain required for compiling the vendored version of RE2 and its
|
333
333
|
dependency [Abseil][] which includes [CMake](https://cmake.org), a compiler
|
334
|
-
with C++
|
335
|
-
[gcc](https://gcc.gnu.org/)
|
334
|
+
with C++17 support such as [clang](http://clang.llvm.org/) 5 or
|
335
|
+
[gcc](https://gcc.gnu.org/) 8 and a recent version of
|
336
336
|
[pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). On
|
337
337
|
Windows, you'll also need pkgconf 2.1.0+ to avoid [`undefined reference`
|
338
338
|
errors](https://github.com/pkgconf/pkgconf/issues/322) when attempting to
|
data/Rakefile
CHANGED
data/dependencies.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
libre2:
|
3
|
-
version: '2025-08-
|
4
|
-
sha256:
|
3
|
+
version: '2025-08-12'
|
4
|
+
sha256: 2f3bec634c3e51ea1faf0d441e0a8718b73ef758d7020175ed7e352df3f6ae12
|
5
5
|
abseil:
|
6
|
-
version: '
|
7
|
-
sha256:
|
6
|
+
version: '20250814.1'
|
7
|
+
sha256: 1692f77d1739bacf3f94337188b78583cf09bab7e420d2dc6c5605a4f86785a1
|
data/ext/re2/extconf.rb
CHANGED
@@ -103,6 +103,8 @@ module RE2
|
|
103
103
|
def build_with_vendored_libraries
|
104
104
|
message "Building re2 using packaged libraries.\n"
|
105
105
|
|
106
|
+
ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.14"
|
107
|
+
|
106
108
|
abseil_recipe, re2_recipe = load_recipes
|
107
109
|
|
108
110
|
process_recipe(abseil_recipe) do |recipe|
|
@@ -129,10 +131,8 @@ module RE2
|
|
129
131
|
end
|
130
132
|
|
131
133
|
def build_extension
|
132
|
-
# Enable optional warnings but disable deprecated register warning for Ruby 2.6 support
|
133
134
|
$CFLAGS << " -Wall -Wextra -funroll-loops"
|
134
135
|
$CXXFLAGS << " -Wall -Wextra -funroll-loops"
|
135
|
-
$CPPFLAGS << " -Wno-register"
|
136
136
|
|
137
137
|
# Pass -x c++ to force gcc to compile the test program
|
138
138
|
# as C++ (as it will end in .c by default).
|
@@ -140,7 +140,6 @@ module RE2
|
|
140
140
|
|
141
141
|
have_library("stdc++")
|
142
142
|
have_header("stdint.h")
|
143
|
-
have_func("rb_gc_mark_movable") # introduced in Ruby 2.7
|
144
143
|
|
145
144
|
minimal_program = <<~SRC
|
146
145
|
#include <re2/re2.h>
|
@@ -152,13 +151,9 @@ module RE2
|
|
152
151
|
end
|
153
152
|
|
154
153
|
if re2_requires_version_flag
|
155
|
-
# Recent versions of
|
156
|
-
# compiler with C++
|
157
|
-
|
158
|
-
# https://github.com/abseil/abseil-cpp/issues/1431). However, the
|
159
|
-
# `std=c++14` flag doesn't appear to suffice; we need at least
|
160
|
-
# `std=c++17`.
|
161
|
-
abort "Cannot compile re2 with your compiler: recent versions require C++14 support." unless %w[c++20 c++17 c++11 c++0x].any? do |std|
|
154
|
+
# Recent versions of RE2 depend directly on Abseil, which requires a
|
155
|
+
# compiler with C++17 support.
|
156
|
+
abort "Cannot compile re2 with your compiler: recent versions require C++17 support." unless %w[c++20 c++17 c++11 c++0x].any? do |std|
|
162
157
|
checking_for("re2 that compiles with #{std} standard") do
|
163
158
|
if try_compile(minimal_program, compile_options + " -std=#{std}")
|
164
159
|
compile_options << " -std=#{std}"
|
data/ext/re2/re2.cc
CHANGED
@@ -125,27 +125,17 @@ static void parse_re2_options(RE2::Options* re2_options, const VALUE options) {
|
|
125
125
|
}
|
126
126
|
}
|
127
127
|
|
128
|
-
/* For compatibility with Ruby < 2.7 */
|
129
|
-
#ifdef HAVE_RB_GC_MARK_MOVABLE
|
130
|
-
#define re2_compact_callback(x) (x),
|
131
|
-
#else
|
132
|
-
#define rb_gc_mark_movable(x) rb_gc_mark(x)
|
133
|
-
#define re2_compact_callback(x)
|
134
|
-
#endif
|
135
|
-
|
136
128
|
static void re2_matchdata_mark(void *ptr) {
|
137
129
|
re2_matchdata *m = reinterpret_cast<re2_matchdata *>(ptr);
|
138
130
|
rb_gc_mark_movable(m->regexp);
|
139
131
|
rb_gc_mark_movable(m->text);
|
140
132
|
}
|
141
133
|
|
142
|
-
#ifdef HAVE_RB_GC_MARK_MOVABLE
|
143
134
|
static void re2_matchdata_compact(void *ptr) {
|
144
135
|
re2_matchdata *m = reinterpret_cast<re2_matchdata *>(ptr);
|
145
136
|
m->regexp = rb_gc_location(m->regexp);
|
146
137
|
m->text = rb_gc_location(m->text);
|
147
138
|
}
|
148
|
-
#endif
|
149
139
|
|
150
140
|
static void re2_matchdata_free(void *ptr) {
|
151
141
|
re2_matchdata *m = reinterpret_cast<re2_matchdata *>(ptr);
|
@@ -171,7 +161,7 @@ static const rb_data_type_t re2_matchdata_data_type = {
|
|
171
161
|
re2_matchdata_mark,
|
172
162
|
re2_matchdata_free,
|
173
163
|
re2_matchdata_memsize,
|
174
|
-
|
164
|
+
re2_matchdata_compact
|
175
165
|
},
|
176
166
|
0,
|
177
167
|
0,
|
@@ -186,13 +176,11 @@ static void re2_scanner_mark(void *ptr) {
|
|
186
176
|
rb_gc_mark_movable(s->text);
|
187
177
|
}
|
188
178
|
|
189
|
-
#ifdef HAVE_RB_GC_MARK_MOVABLE
|
190
179
|
static void re2_scanner_compact(void *ptr) {
|
191
180
|
re2_scanner *s = reinterpret_cast<re2_scanner *>(ptr);
|
192
181
|
s->regexp = rb_gc_location(s->regexp);
|
193
182
|
s->text = rb_gc_location(s->text);
|
194
183
|
}
|
195
|
-
#endif
|
196
184
|
|
197
185
|
static void re2_scanner_free(void *ptr) {
|
198
186
|
re2_scanner *s = reinterpret_cast<re2_scanner *>(ptr);
|
@@ -218,7 +206,7 @@ static const rb_data_type_t re2_scanner_data_type = {
|
|
218
206
|
re2_scanner_mark,
|
219
207
|
re2_scanner_free,
|
220
208
|
re2_scanner_memsize,
|
221
|
-
|
209
|
+
re2_scanner_compact
|
222
210
|
},
|
223
211
|
0,
|
224
212
|
0,
|
data/ext/re2/recipes.rb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
# Released under the BSD Licence, please see LICENSE.txt
|
10
10
|
|
11
11
|
PACKAGE_ROOT_DIR = File.expand_path('../..', __dir__)
|
12
|
-
REQUIRED_MINI_PORTILE_VERSION = '~> 2.8.
|
12
|
+
REQUIRED_MINI_PORTILE_VERSION = '~> 2.8.9' # keep this version in sync with the one in the gemspec
|
13
13
|
|
14
14
|
def load_recipes
|
15
15
|
require 'yaml'
|
@@ -40,8 +40,8 @@ def build_recipe(name, version)
|
|
40
40
|
MiniPortileCMake.new(name, version).tap do |recipe|
|
41
41
|
recipe.target = File.join(PACKAGE_ROOT_DIR, 'ports')
|
42
42
|
recipe.configure_options += [
|
43
|
-
# abseil needs a C++
|
44
|
-
'-DCMAKE_CXX_STANDARD=
|
43
|
+
# abseil needs a C++17 compiler
|
44
|
+
'-DCMAKE_CXX_STANDARD=17',
|
45
45
|
# needed for building the C extension shared library with -fPIC
|
46
46
|
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
|
47
47
|
# ensures pkg-config and installed libraries will be in lib, not lib64
|
data/lib/re2/version.rb
CHANGED
Binary file
|
Binary file
|
data/re2.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "https://github.com/mudge/re2"
|
12
12
|
s.extensions = ["ext/re2/extconf.rb"]
|
13
13
|
s.license = "BSD-3-Clause"
|
14
|
-
s.required_ruby_version = ">=
|
14
|
+
s.required_ruby_version = ">= 3.1.0"
|
15
15
|
s.files = [
|
16
16
|
"dependencies.yml",
|
17
17
|
"ext/re2/extconf.rb",
|
@@ -40,8 +40,8 @@ Gem::Specification.new do |s|
|
|
40
40
|
"spec/re2/set_spec.rb",
|
41
41
|
"spec/re2/scanner_spec.rb"
|
42
42
|
]
|
43
|
-
s.add_development_dependency("rake-compiler", "~> 1.
|
43
|
+
s.add_development_dependency("rake-compiler", "~> 1.3.0")
|
44
44
|
s.add_development_dependency("rake-compiler-dock", "~> 1.9.1")
|
45
45
|
s.add_development_dependency("rspec", "~> 3.2")
|
46
|
-
s.add_runtime_dependency("mini_portile2", "~> 2.8.
|
46
|
+
s.add_runtime_dependency("mini_portile2", "~> 2.8.9") # keep version in sync with extconf.rb
|
47
47
|
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.
|
4
|
+
version: 2.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Mucur
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.3.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake-compiler-dock
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.8.
|
61
|
+
version: 2.8.9
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.8.
|
68
|
+
version: 2.8.9
|
69
69
|
description: Ruby bindings to RE2, "a fast, safe, thread-friendly alternative to backtracking
|
70
70
|
regular expression engines like those used in PCRE, Perl, and Python".
|
71
71
|
executables: []
|
@@ -88,8 +88,8 @@ files:
|
|
88
88
|
- lib/re2/scanner.rb
|
89
89
|
- lib/re2/string.rb
|
90
90
|
- lib/re2/version.rb
|
91
|
-
- ports/archives/
|
92
|
-
- ports/archives/re2-2025-08-
|
91
|
+
- ports/archives/20250814.1.tar.gz
|
92
|
+
- ports/archives/re2-2025-08-12.tar.gz
|
93
93
|
- re2.gemspec
|
94
94
|
- spec/kernel_spec.rb
|
95
95
|
- spec/re2/match_data_spec.rb
|
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
113
|
+
version: 3.1.0
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - ">="
|
Binary file
|
Binary file
|