re2 2.1.3 → 2.3.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 +2 -2
- data/dependencies.yml +5 -7
- data/ext/re2/extconf.rb +6 -2
- data/ext/re2/recipes.rb +2 -2
- data/lib/re2/version.rb +1 -1
- data/ports/archives/20230802.1.tar.gz +0 -0
- data/ports/archives/re2-2023-11-01.tar.gz +0 -0
- data/re2.gemspec +1 -1
- data/spec/kernel_spec.rb +16 -0
- data/spec/re2/regexp_spec.rb +19 -3
- data/spec/re2_spec.rb +6 -4
- metadata +6 -6
- data/ports/archives/20230125.3.tar.gz +0 -0
- data/ports/archives/re2-2023-09-01.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: 5a13971802fb657d7882e4a7d104673ede16481ec279ca791b173278e69e2f16
|
4
|
+
data.tar.gz: c911db8b2c8a10d6c2ead9ee6f6242cb77cccf832ba685927fef9191ba64cb30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0516976272847272023485d8830e1ab25e3a30c066ab6268a3d7ce5594a543f5450639fc24f4fdd83952c66b5a20302f06f06d53bd50eb388304763b77cbf364'
|
7
|
+
data.tar.gz: 73917e5ac5721e4dfbd9e4163ff738686ac0da1dda15c2c1bce1919a19627927f61e5e3b1dcdb0926f0fe46dbb84d202a94dba85d926bc8e48893bf50f50f503
|
data/README.md
CHANGED
@@ -5,9 +5,9 @@ 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.
|
8
|
+
**Current version:** 2.3.0
|
9
9
|
**Supported Ruby versions:** 2.6, 2.7, 3.0, 3.1, 3.2
|
10
|
-
**Bundled RE2 version:** libre2.11 (2023-
|
10
|
+
**Bundled RE2 version:** libre2.11 (2023-11-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)
|
12
12
|
|
13
13
|
Installation
|
data/dependencies.yml
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
+
---
|
1
2
|
libre2:
|
2
|
-
version:
|
3
|
-
sha256:
|
4
|
-
# sha-256 hash provided in https://github.com/google/re2/releases/download/2023-09-01/re2-2023-09-01.tar.gz
|
5
|
-
|
3
|
+
version: '2023-11-01'
|
4
|
+
sha256: 4e6593ac3c71de1c0f322735bc8b0492a72f66ffccfad76e259fa21c41d27d8a
|
6
5
|
abseil:
|
7
|
-
version:
|
8
|
-
sha256:
|
9
|
-
# sha-256 hash provided in https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.tar.gz
|
6
|
+
version: '20230802.1'
|
7
|
+
sha256: 987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed
|
data/ext/re2/extconf.rb
CHANGED
@@ -296,17 +296,18 @@ ABSL_LDFLAGS = %w[
|
|
296
296
|
-labsl_crc32c
|
297
297
|
-labsl_crc_internal
|
298
298
|
-labsl_crc_cpu_detect
|
299
|
+
-labsl_raw_hash_set
|
299
300
|
-labsl_hash
|
300
301
|
-labsl_city
|
301
302
|
-labsl_bad_variant_access
|
302
303
|
-labsl_low_level_hash
|
303
|
-
-labsl_raw_hash_set
|
304
304
|
-labsl_hashtablez_sampler
|
305
305
|
-labsl_exponential_biased
|
306
306
|
-labsl_bad_optional_access
|
307
307
|
-labsl_str_format_internal
|
308
308
|
-labsl_synchronization
|
309
309
|
-labsl_graphcycles_internal
|
310
|
+
-labsl_kernel_timeout_internal
|
310
311
|
-labsl_stacktrace
|
311
312
|
-labsl_symbolize
|
312
313
|
-ldbghelp
|
@@ -316,9 +317,10 @@ ABSL_LDFLAGS = %w[
|
|
316
317
|
-labsl_time
|
317
318
|
-labsl_civil_time
|
318
319
|
-labsl_strings
|
320
|
+
-labsl_string_view
|
319
321
|
-labsl_strings_internal
|
320
|
-
-ladvapi32
|
321
322
|
-labsl_base
|
323
|
+
-ladvapi32
|
322
324
|
-labsl_spinlock_wait
|
323
325
|
-labsl_int128
|
324
326
|
-labsl_throw_delegate
|
@@ -396,6 +398,8 @@ def build_with_vendored_libraries
|
|
396
398
|
|
397
399
|
process_recipe(abseil_recipe) do |recipe|
|
398
400
|
recipe.configure_options += ['-DABSL_PROPAGATE_CXX_STD=ON', '-DCMAKE_CXX_VISIBILITY_PRESET=hidden']
|
401
|
+
# Workaround for https://github.com/abseil/abseil-cpp/issues/1510
|
402
|
+
recipe.configure_options += ['-DCMAKE_CXX_FLAGS=-DABSL_FORCE_WAITER_MODE=4'] if windows?
|
399
403
|
end
|
400
404
|
|
401
405
|
process_recipe(re2_recipe) do |recipe|
|
data/ext/re2/recipes.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
PACKAGE_ROOT_DIR = File.expand_path('../..', __dir__)
|
2
|
-
REQUIRED_MINI_PORTILE_VERSION = '~> 2.8.
|
2
|
+
REQUIRED_MINI_PORTILE_VERSION = '~> 2.8.5' # keep this version in sync with the one in the gemspec
|
3
3
|
|
4
4
|
def build_recipe(name, version)
|
5
5
|
require 'rubygems'
|
@@ -10,7 +10,7 @@ def build_recipe(name, version)
|
|
10
10
|
recipe.target = File.join(PACKAGE_ROOT_DIR, 'ports')
|
11
11
|
recipe.configure_options += [
|
12
12
|
# abseil needs a C++14 compiler
|
13
|
-
'-DCMAKE_CXX_STANDARD=
|
13
|
+
'-DCMAKE_CXX_STANDARD=14',
|
14
14
|
# needed for building the C extension shared library with -fPIC
|
15
15
|
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
|
16
16
|
# 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
@@ -40,5 +40,5 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.add_development_dependency("rake-compiler", "~> 1.2.1")
|
41
41
|
s.add_development_dependency("rake-compiler-dock", "~> 1.3.0")
|
42
42
|
s.add_development_dependency("rspec", "~> 3.2")
|
43
|
-
s.add_runtime_dependency("mini_portile2", "~> 2.8.
|
43
|
+
s.add_runtime_dependency("mini_portile2", "~> 2.8.5") # keep version in sync with extconf.rb
|
44
44
|
end
|
data/spec/kernel_spec.rb
CHANGED
@@ -9,5 +9,21 @@ RSpec.describe Kernel do
|
|
9
9
|
|
10
10
|
expect(re).not_to be_case_sensitive
|
11
11
|
end
|
12
|
+
|
13
|
+
it "raises an error if given an inappropriate type" do
|
14
|
+
expect { RE2(nil) }.to raise_error(TypeError)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "allows invalid patterns to be created" do
|
18
|
+
re = RE2('???', :log_errors => false)
|
19
|
+
|
20
|
+
expect(re).to be_a(RE2::Regexp)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "supports passing something that can be coerced to a String as input" do
|
24
|
+
re = RE2(StringLike.new('w(o)(o)'))
|
25
|
+
|
26
|
+
expect(re).to be_a(RE2::Regexp)
|
27
|
+
end
|
12
28
|
end
|
13
29
|
end
|
data/spec/re2/regexp_spec.rb
CHANGED
@@ -18,9 +18,15 @@ RSpec.describe RE2::Regexp do
|
|
18
18
|
re = RE2::Regexp.new('???', :log_errors => false)
|
19
19
|
expect(re).to be_a(RE2::Regexp)
|
20
20
|
end
|
21
|
+
|
22
|
+
it "supports passing something that can be coerced to a String as input" do
|
23
|
+
re = RE2::Regexp.new(StringLike.new('w(o)(o)'))
|
24
|
+
|
25
|
+
expect(re).to be_a(RE2::Regexp)
|
26
|
+
end
|
21
27
|
end
|
22
28
|
|
23
|
-
describe "
|
29
|
+
describe ".compile" do
|
24
30
|
it "returns an instance given only a pattern" do
|
25
31
|
re = RE2::Regexp.compile('woo')
|
26
32
|
expect(re).to be_a(RE2::Regexp)
|
@@ -31,10 +37,20 @@ RSpec.describe RE2::Regexp do
|
|
31
37
|
expect(re).to be_a(RE2::Regexp)
|
32
38
|
end
|
33
39
|
|
40
|
+
it "raises an error if given an inappropriate type" do
|
41
|
+
expect { RE2::Regexp.compile(nil) }.to raise_error(TypeError)
|
42
|
+
end
|
43
|
+
|
34
44
|
it "allows invalid patterns to be created" do
|
35
45
|
re = RE2::Regexp.compile('???', :log_errors => false)
|
36
46
|
expect(re).to be_a(RE2::Regexp)
|
37
47
|
end
|
48
|
+
|
49
|
+
it "supports passing something that can be coerced to a String as input" do
|
50
|
+
re = RE2::Regexp.compile(StringLike.new('w(o)(o)'))
|
51
|
+
|
52
|
+
expect(re).to be_a(RE2::Regexp)
|
53
|
+
end
|
38
54
|
end
|
39
55
|
|
40
56
|
describe "#options" do
|
@@ -59,7 +75,7 @@ RSpec.describe RE2::Regexp do
|
|
59
75
|
|
60
76
|
it "is populated with overridden options when specified" do
|
61
77
|
options = RE2::Regexp.new('woo', :case_sensitive => false).options
|
62
|
-
expect(options
|
78
|
+
expect(options).to include(:case_sensitive => false)
|
63
79
|
end
|
64
80
|
end
|
65
81
|
|
@@ -82,7 +98,7 @@ RSpec.describe RE2::Regexp do
|
|
82
98
|
expect(error_arg).to be_nil
|
83
99
|
end
|
84
100
|
|
85
|
-
it "returns the offending
|
101
|
+
it "returns the offending portion of the regexp if there is an error" do
|
86
102
|
error_arg = RE2::Regexp.new('wo(o', :log_errors => false).error_arg
|
87
103
|
expect(error_arg).to eq("wo(o")
|
88
104
|
end
|
data/spec/re2_spec.rb
CHANGED
@@ -12,11 +12,12 @@ RSpec.describe RE2 do
|
|
12
12
|
expect(RE2.Replace("Good morning", "(?i)gOOD MORNING", "hi")).to eq("hi")
|
13
13
|
end
|
14
14
|
|
15
|
-
it "does not perform replacements in-place" do
|
15
|
+
it "does not perform replacements in-place", :aggregate_failures do
|
16
16
|
name = "Robert"
|
17
17
|
replacement = RE2.Replace(name, "R", "Cr")
|
18
18
|
|
19
|
-
expect(name).
|
19
|
+
expect(name).to eq("Robert")
|
20
|
+
expect(replacement).to eq("Crobert")
|
20
21
|
end
|
21
22
|
|
22
23
|
it "supports passing an RE2::Regexp as the pattern" do
|
@@ -89,11 +90,12 @@ RSpec.describe RE2 do
|
|
89
90
|
expect(RE2.GlobalReplace("Robert", "(?i)r", "w")).to eq("wobewt")
|
90
91
|
end
|
91
92
|
|
92
|
-
it "does not perform replacement in-place" do
|
93
|
+
it "does not perform replacement in-place", :aggregate_failures do
|
93
94
|
name = "Robert"
|
94
95
|
replacement = RE2.GlobalReplace(name, "(?i)R", "w")
|
95
96
|
|
96
|
-
expect(name).
|
97
|
+
expect(name).to eq("Robert")
|
98
|
+
expect(replacement).to eq("wobewt")
|
97
99
|
end
|
98
100
|
|
99
101
|
it "supports passing an RE2::Regexp as the pattern" do
|
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.3.0
|
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-
|
12
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 2.8.
|
62
|
+
version: 2.8.5
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.8.
|
69
|
+
version: 2.8.5
|
70
70
|
description: Ruby bindings to RE2, "a fast, safe, thread-friendly alternative to backtracking
|
71
71
|
regular expression engines like those used in PCRE, Perl, and Python".
|
72
72
|
email:
|
@@ -89,8 +89,8 @@ files:
|
|
89
89
|
- lib/re2/scanner.rb
|
90
90
|
- lib/re2/string.rb
|
91
91
|
- lib/re2/version.rb
|
92
|
-
- ports/archives/
|
93
|
-
- ports/archives/re2-2023-
|
92
|
+
- ports/archives/20230802.1.tar.gz
|
93
|
+
- ports/archives/re2-2023-11-01.tar.gz
|
94
94
|
- re2.gemspec
|
95
95
|
- spec/kernel_spec.rb
|
96
96
|
- spec/re2/match_data_spec.rb
|
Binary file
|
Binary file
|