re2 2.14.0-x86-mingw32 → 2.16.0-x86-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f127939847063a811a50d4c3ba7061ba71e3d1308bde2164cd60c980bec5300
4
- data.tar.gz: 63620cd9ab71d58a4b71b191cd81f89cd92e493c748f9c2be62503704fb00ffb
3
+ metadata.gz: 06e593085810b30fcafd5a0e68c95097e88508e6914d921ee34452e24c55c2ea
4
+ data.tar.gz: a673ed7a1688c62bacbf03e5984711de54ff88555876a08318f754c2735f6b06
5
5
  SHA512:
6
- metadata.gz: 25c352f96df60018dc24cdc69731ff57b8d6f80dcbc66c563ba28cc963fbd67208ea79e158fe4abbbe9f7c0f468b496b87cde153443f08d6cb3f79823a3e4453
7
- data.tar.gz: 5ccbc92c7249b6d47c3bdcaaf64d3b50feae16cd144175079c7067d3b463337df6936990d3da53778f8562aca3756554ebf52b797d0d4bcfd6c43a375858a0b4
6
+ metadata.gz: e996666e9e2f69b0c65565dc78b0e686adeda207d55ba63777c86bfc94edfd1cab3cf0f65205ca1fd6c674d3484602227576918cb8e5b14d052ef244c60a04b6
7
+ data.tar.gz: 17da7b25caafbfaacf2d5dc240e6fb8fb59815003c9ddc7aacf08c632d62735bb87cdbfe89f396c8b3167f2d98f107b78469dd823c6bef8a4f8f9ece47d0d4fc
data/README.md CHANGED
@@ -6,8 +6,8 @@ Python".
6
6
 
7
7
  [![Build Status](https://github.com/mudge/re2/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/mudge/re2/actions)
8
8
 
9
- **Current version:** 2.14.0
10
- **Bundled RE2 version:** libre2.11 (2024-07-02)
9
+ **Current version:** 2.16.0
10
+ **Bundled RE2 version:** libre2.11 (2025-06-26b)
11
11
 
12
12
  ```ruby
13
13
  RE2('h.*o').full_match?("hello") #=> true
@@ -224,12 +224,15 @@ the set. After all patterns have been added, the set can be compiled using
224
224
  and then
225
225
  [`RE2::Set#match`](https://mudge.name/re2/RE2/Set.html#match-instance_method)
226
226
  will return an array containing the indices of all the patterns that matched.
227
+ [`RE2::Set#size`](https://mudge.name/re2/RE2/Set.html#size-instance_method)
228
+ will return the number of patterns in the set.
227
229
 
228
230
  ```ruby
229
231
  set = RE2::Set.new
230
232
  set.add("abc") #=> 0
231
233
  set.add("def") #=> 1
232
234
  set.add("ghi") #=> 2
235
+ set.size #=> 3
233
236
  set.compile #=> true
234
237
  set.match("abcdefghi") #=> [0, 1, 2]
235
238
  set.match("ghidefabc") #=> [2, 1, 0]
@@ -257,20 +260,19 @@ RE2(non_latin1_pattern.encode("ISO-8859-1"), utf8: false).match(non_latin1_text.
257
260
 
258
261
  This gem requires the following to run:
259
262
 
260
- * [Ruby](https://www.ruby-lang.org/en/) 2.6 to 3.3
263
+ * [Ruby](https://www.ruby-lang.org/en/) 2.6 to 3.4
261
264
 
262
265
  It supports the following RE2 ABI versions:
263
266
 
264
- * libre2.0 (prior to release 2020-03-02) to libre2.11 (2023-07-01 to 2024-07-02)
267
+ * libre2.0 (prior to release 2020-03-02) to libre2.11 (2023-07-01 to 2025-06-26b)
265
268
 
266
269
  ### Native gems
267
270
 
268
271
  Where possible, a pre-compiled native gem will be provided for the following platforms:
269
272
 
270
273
  * Linux
271
- * `aarch64-linux` and `arm-linux` (requires [glibc](https://www.gnu.org/software/libc/) 2.29+)
272
- * `x86-linux` and `x86_64-linux` (requires [glibc](https://www.gnu.org/software/libc/) 2.17+)
273
- * [musl](https://musl.libc.org/)-based systems such as [Alpine](https://alpinelinux.org) are supported as long as a [glibc-compatible library is installed](https://wiki.alpinelinux.org/wiki/Running_glibc_programs)
274
+ * `aarch64-linux`, `arm-linux`, `x86-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
+ * [musl](https://musl.libc.org/)-based systems such as [Alpine](https://alpinelinux.org) are supported with Bundler 2.5.6+
274
276
  * macOS `x86_64-darwin` and `arm64-darwin`
275
277
  * Windows `x64-mingw32` and `x64-mingw-ucrt`
276
278
 
@@ -279,18 +281,18 @@ Where possible, a pre-compiled native gem will be provided for the following pla
279
281
  SHA256 checksums are included in the [release notes](https://github.com/mudge/re2/releases) for each version and can be checked with `sha256sum`, e.g.
280
282
 
281
283
  ```console
282
- $ gem fetch re2 -v 2.13.1
283
- Fetching re2-2.13.1-arm64-darwin.gem
284
- Downloaded re2-2.13.1-arm64-darwin
285
- $ sha256sum re2-2.13.1-arm64-darwin.gem
286
- 57dc2a77cef60ed8ba35e2f647a6dd17bcba99bfdb0bcb5b08bff69cd566f0be re2-2.13.1-arm64-darwin.gem
284
+ $ gem fetch re2 -v 2.14.0
285
+ Fetching re2-2.14.0-arm64-darwin.gem
286
+ Downloaded re2-2.14.0-arm64-darwin
287
+ $ sha256sum re2-2.14.0-arm64-darwin.gem
288
+ 3c922d54a44ac88499f6391bc2f9740559381deaf7f4e49eef5634cf32efc2ce re2-2.14.0-arm64-darwin.gem
287
289
  ```
288
290
 
289
291
  [GPG](https://www.gnupg.org/) signatures are attached to each release (the assets ending in `.sig`) and can be verified if you import [our signing key `0x39AC3530070E0F75`](https://mudge.name/39AC3530070E0F75.asc) (or fetch it from a public keyserver, e.g. `gpg --keyserver keyserver.ubuntu.com --recv-key 0x39AC3530070E0F75`):
290
292
 
291
293
  ```console
292
- $ gpg --verify re2-2.13.1-arm64-darwin.gem.sig re2-2.13.1-arm64-darwin.gem
293
- gpg: Signature made Mon 1 Jul 17:51:09 2024 BST
294
+ $ gpg --verify re2-2.14.0-arm64-darwin.gem.sig re2-2.14.0-arm64-darwin.gem
295
+ gpg: Signature made Fri 2 Aug 12:39:12 2024 BST
294
296
  gpg: using RSA key 702609D9C790F45B577D7BEC39AC3530070E0F75
295
297
  gpg: Good signature from "Paul Mucur <mudge@mudge.name>" [unknown]
296
298
  gpg: aka "Paul Mucur <paul@ghostcassette.com>" [unknown]
data/Rakefile CHANGED
@@ -18,18 +18,22 @@ re2_gemspec.files << abseil_archive
18
18
  re2_gemspec.files << re2_archive
19
19
 
20
20
  cross_platforms = %w[
21
- aarch64-linux
22
- arm-linux
21
+ aarch64-linux-gnu
22
+ aarch64-linux-musl
23
+ arm-linux-gnu
24
+ arm-linux-musl
23
25
  arm64-darwin
24
26
  x64-mingw-ucrt
25
27
  x64-mingw32
26
- x86-linux
28
+ x86-linux-gnu
29
+ x86-linux-musl
27
30
  x86-mingw32
28
31
  x86_64-darwin
29
- x86_64-linux
32
+ x86_64-linux-gnu
33
+ x86_64-linux-musl
30
34
  ].freeze
31
35
 
32
- ENV['RUBY_CC_VERSION'] = %w[3.3.0 3.2.0 3.1.0 3.0.0 2.7.0 2.6.0].join(':')
36
+ RakeCompilerDock.set_ruby_cc_version("~> 2.6", "~> 3.0")
33
37
 
34
38
  Gem::PackageTask.new(re2_gemspec).define
35
39
 
@@ -66,6 +70,7 @@ namespace :gem do
66
70
  desc "Compile and build native gem for #{platform} platform"
67
71
  task platform do
68
72
  RakeCompilerDock.sh <<~SCRIPT, platform: platform, verbose: true
73
+ rbenv shell 3.1.6 &&
69
74
  gem install bundler --no-document &&
70
75
  bundle &&
71
76
  bundle exec rake native:#{platform} pkg/#{re2_gemspec.full_name}-#{Gem::Platform.new(platform)}.gem PATH="/usr/local/bin:$PATH"
data/dependencies.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  libre2:
3
- version: '2024-07-02'
4
- sha256: eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b
3
+ version: 2025-06-26b
4
+ sha256: 641a3ca337814a6c3676a389ea065812e00ff796f31a427038bc010bae0b86e3
5
5
  abseil:
6
- version: '20240722.0'
7
- sha256: f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3
6
+ version: '20250127.1'
7
+ sha256: b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811
data/ext/re2/extconf.rb CHANGED
@@ -217,6 +217,24 @@ module RE2
217
217
  $defs.push("-DHAVE_ERROR_INFO_ARGUMENT")
218
218
  end
219
219
  end
220
+
221
+ checking_for("RE2::Set::Size()") do
222
+ test_re2_set_size = <<~SRC
223
+ #include <re2/re2.h>
224
+ #include <re2/set.h>
225
+
226
+ int main() {
227
+ RE2::Set s(RE2::DefaultOptions, RE2::UNANCHORED);
228
+ s.Size();
229
+
230
+ return 0;
231
+ }
232
+ SRC
233
+
234
+ if try_compile(test_re2_set_size, compile_options)
235
+ $defs.push("-DHAVE_SET_SIZE")
236
+ end
237
+ end
220
238
  end
221
239
 
222
240
  def static_pkg_config(pc_file, pkg_config_paths)
data/ext/re2/re2.cc CHANGED
@@ -1962,6 +1962,26 @@ static VALUE re2_set_compile(VALUE self) {
1962
1962
  return BOOL2RUBY(s->set->Compile());
1963
1963
  }
1964
1964
 
1965
+ /*
1966
+ * Returns the size of the {RE2::Set}.
1967
+ *
1968
+ * @return [Integer] the number of patterns in the set
1969
+ * @example
1970
+ * set = RE2::Set.new
1971
+ * set.add("abc")
1972
+ * set.size #=> 1
1973
+ */
1974
+ static VALUE re2_set_size(VALUE self) {
1975
+ #ifdef HAVE_SET_SIZE
1976
+ re2_set *s;
1977
+ TypedData_Get_Struct(self, re2_set, &re2_set_data_type, s);
1978
+
1979
+ return INT2FIX(s->set->Size());
1980
+ #else
1981
+ rb_raise(re2_eSetUnsupportedError, "current version of RE2::Set does not have Size method");
1982
+ #endif
1983
+ }
1984
+
1965
1985
  /*
1966
1986
  * Returns whether the underlying RE2 version outputs error information from
1967
1987
  * {https://github.com/google/re2/blob/bc0faab533e2b27b85b8ad312abf061e33ed6b5d/re2/set.h#L62-L65
@@ -1978,6 +1998,19 @@ static VALUE re2_set_match_raises_errors_p(VALUE) {
1978
1998
  #endif
1979
1999
  }
1980
2000
 
2001
+ /*
2002
+ * Returns whether the underlying RE2 version has a Set::Size method.
2003
+ *
2004
+ * @return [Boolean] whether the underlying RE2 has a Set::Size method
2005
+ */
2006
+ static VALUE re2_set_size_p(VALUE) {
2007
+ #ifdef HAVE_SET_SIZE
2008
+ return Qtrue;
2009
+ #else
2010
+ return Qfalse;
2011
+ #endif
2012
+ }
2013
+
1981
2014
  /*
1982
2015
  * Matches the given text against patterns in the set, returning an array of
1983
2016
  * integer indices of the matching patterns if matched or an empty array if
@@ -2208,11 +2241,15 @@ extern "C" void Init_re2(void) {
2208
2241
 
2209
2242
  rb_define_singleton_method(re2_cSet, "match_raises_errors?",
2210
2243
  RUBY_METHOD_FUNC(re2_set_match_raises_errors_p), 0);
2244
+ rb_define_singleton_method(re2_cSet, "size?",
2245
+ RUBY_METHOD_FUNC(re2_set_size_p), 0);
2211
2246
  rb_define_method(re2_cSet, "initialize",
2212
2247
  RUBY_METHOD_FUNC(re2_set_initialize), -1);
2213
2248
  rb_define_method(re2_cSet, "add", RUBY_METHOD_FUNC(re2_set_add), 1);
2214
2249
  rb_define_method(re2_cSet, "compile", RUBY_METHOD_FUNC(re2_set_compile), 0);
2215
2250
  rb_define_method(re2_cSet, "match", RUBY_METHOD_FUNC(re2_set_match), -1);
2251
+ rb_define_method(re2_cSet, "size", RUBY_METHOD_FUNC(re2_set_size), 0);
2252
+ rb_define_method(re2_cSet, "length", RUBY_METHOD_FUNC(re2_set_size), 0);
2216
2253
 
2217
2254
  rb_define_module_function(re2_mRE2, "Replace",
2218
2255
  RUBY_METHOD_FUNC(re2_Replace), 3);
data/lib/2.6/re2.so CHANGED
Binary file
data/lib/2.7/re2.so CHANGED
Binary file
data/lib/3.0/re2.so CHANGED
Binary file
data/lib/3.1/re2.so CHANGED
Binary file
data/lib/3.2/re2.so CHANGED
Binary file
data/lib/3.3/re2.so CHANGED
Binary file
data/lib/3.4/re2.so ADDED
Binary file
data/lib/re2/version.rb CHANGED
@@ -10,5 +10,5 @@
10
10
 
11
11
 
12
12
  module RE2
13
- VERSION = "2.14.0"
13
+ VERSION = "2.16.0"
14
14
  end
data/re2.gemspec CHANGED
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  "spec/re2/scanner_spec.rb"
42
42
  ]
43
43
  s.add_development_dependency("rake-compiler", "~> 1.2.7")
44
- s.add_development_dependency("rake-compiler-dock", "~> 1.5.2")
44
+ s.add_development_dependency("rake-compiler-dock", "~> 1.9.1")
45
45
  s.add_development_dependency("rspec", "~> 3.2")
46
46
  s.add_runtime_dependency("mini_portile2", "~> 2.8.7") # keep version in sync with extconf.rb
47
47
  end
data/spec/re2/set_spec.rb CHANGED
@@ -204,6 +204,50 @@ RSpec.describe RE2::Set do
204
204
  end
205
205
  end
206
206
 
207
+ describe "#size" do
208
+ it "returns the number of patterns added to the set", :aggregate_failures do
209
+ skip "Underlying RE2::Set has no Size method" unless RE2::Set.size?
210
+
211
+ set = RE2::Set.new
212
+
213
+ expect(set.size).to eq(0)
214
+
215
+ set.add("abc")
216
+
217
+ expect(set.size).to eq(1)
218
+
219
+ set.add("def")
220
+
221
+ expect(set.size).to eq(2)
222
+ end
223
+
224
+ it "raises an error if RE2 does not support Set::Size" do
225
+ skip "Underlying RE2::Set has a Size method" if RE2::Set.size?
226
+
227
+ set = RE2::Set.new
228
+
229
+ expect { set.size }.to raise_error(RE2::Set::UnsupportedError)
230
+ end
231
+ end
232
+
233
+ describe "#length" do
234
+ it "is an alias for size" do
235
+ skip "Underlying RE2::Set has no Size method" unless RE2::Set.size?
236
+
237
+ set = RE2::Set.new
238
+
239
+ expect(set.length).to eq(0)
240
+
241
+ set.add("abc")
242
+
243
+ expect(set.length).to eq(1)
244
+
245
+ set.add("def")
246
+
247
+ expect(set.length).to eq(2)
248
+ end
249
+ end
250
+
207
251
  def silence_stderr
208
252
  original_stream = STDERR
209
253
 
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.14.0
4
+ version: 2.16.0
5
5
  platform: x86-mingw32
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: 2024-08-02 00:00:00.000000000 Z
12
+ date: 2025-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 1.5.2
34
+ version: 1.9.1
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 1.5.2
41
+ version: 1.9.1
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -76,6 +76,7 @@ files:
76
76
  - lib/3.1/re2.so
77
77
  - lib/3.2/re2.so
78
78
  - lib/3.3/re2.so
79
+ - lib/3.4/re2.so
79
80
  - lib/re2.rb
80
81
  - lib/re2/regexp.rb
81
82
  - lib/re2/scanner.rb
@@ -105,14 +106,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
106
  version: '2.6'
106
107
  - - "<"
107
108
  - !ruby/object:Gem::Version
108
- version: 3.4.dev
109
+ version: 3.5.dev
109
110
  required_rubygems_version: !ruby/object:Gem::Requirement
110
111
  requirements:
111
112
  - - ">="
112
113
  - !ruby/object:Gem::Version
113
114
  version: '0'
114
115
  requirements: []
115
- rubygems_version: 3.3.26
116
+ rubygems_version: 3.3.27
116
117
  signing_key:
117
118
  specification_version: 4
118
119
  summary: Ruby bindings to RE2.