fakefs 1.3.1 → 1.3.2
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/lib/fakefs/globber.rb +12 -11
- data/lib/fakefs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05aa1f68c0f9298802a4171ba6b109e53cb2e020b9b6f2973872ce4cc4de6ce1
|
4
|
+
data.tar.gz: 566bdaeab08f35a081857a4a76170c6b94f29bf928735f81470a19e4280297e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25dd82ac5d99560aee6642ee5faea80ee35cf0b70610d6b1f7b3e4cd7369c78f9acf9fce6567ad4ae0409c82e388917a220f4acc2637875768df486127491cf9
|
7
|
+
data.tar.gz: 8d087e11e9c7ba065bf07b4cff4ff51011ecf903fd830aa5ec51d8dcb2c18ded53c3cfbf38cc8226f7d4f46590bc3868fa902bfcc2011c1e19c1586868a920eb
|
data/lib/fakefs/globber.rb
CHANGED
@@ -63,20 +63,21 @@ module FakeFS
|
|
63
63
|
def regexp(pattern, find_flags = 0, gave_char_class = false)
|
64
64
|
pattern = pattern.to_s
|
65
65
|
|
66
|
+
# Escape .+?*()$ characters unless already escaped.
|
66
67
|
regex_body =
|
67
68
|
pattern
|
68
|
-
.gsub(
|
69
|
-
.gsub(
|
70
|
-
.gsub(
|
71
|
-
.gsub(
|
72
|
-
.gsub(
|
73
|
-
.gsub(
|
74
|
-
.gsub(
|
75
|
-
|
76
|
-
#
|
77
|
-
# since if we're expecting them, the string should already be properly escaped
|
69
|
+
.gsub(/(?<!\\)\./, '\.')
|
70
|
+
.gsub(/(?<!\\)\+/) { '\+' }
|
71
|
+
.gsub(/(?<!\\)\?/, '.')
|
72
|
+
.gsub(/(?<!\\)\*/, '.*')
|
73
|
+
.gsub(/(?<!\\)\(/, '\(')
|
74
|
+
.gsub(/(?<!\\)\)/, '\)')
|
75
|
+
.gsub(/(?<!\\)\$/, '\$')
|
76
|
+
|
77
|
+
# Unless we're expecting character class contructs in regexes, escape all brackets
|
78
|
+
# since if we're expecting them, the string should already be properly escaped.
|
78
79
|
unless gave_char_class
|
79
|
-
regex_body = regex_body.gsub(
|
80
|
+
regex_body = regex_body.gsub(/(?<!\\)([\[\]])/, '\\\\\1')
|
80
81
|
end
|
81
82
|
|
82
83
|
# This matches nested braces and attempts to do something correct most of the time
|
data/lib/fakefs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakefs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-01-04 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|