fakefs 0.8.1 → 0.9.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/lib/fakefs/globber.rb +19 -4
- data/lib/fakefs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1756dfd4964229d1598029e509f5b24d467be877
|
4
|
+
data.tar.gz: 155b59626308b2de917a6856746ef4e3edc9acd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac2235d6787be8205d1a5c748763e00fc0336398460b6b16e788f56668ec5f6eda261e3f8dbf00b88b1d4031a165c03a382cdc48629b13f7db10da558592bf5
|
7
|
+
data.tar.gz: 588986354e6fc268fea224d4a699a84e98bb894e486c6fd77f6e5675492370285cd831aa9aa2cf099d2ca84976ef7f7bc4117666e813993efcb11385bc734df0
|
data/lib/fakefs/globber.rb
CHANGED
@@ -4,6 +4,8 @@ module FakeFS
|
|
4
4
|
extend self
|
5
5
|
|
6
6
|
def expand(pattern)
|
7
|
+
pattern = pattern.to_s
|
8
|
+
|
7
9
|
return [pattern] if pattern[0] != '{' || pattern[-1] != '}'
|
8
10
|
|
9
11
|
part = ''
|
@@ -39,6 +41,8 @@ module FakeFS
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def path_components(pattern)
|
44
|
+
pattern = pattern.to_s
|
45
|
+
|
42
46
|
part = ''
|
43
47
|
result = []
|
44
48
|
|
@@ -57,16 +61,27 @@ module FakeFS
|
|
57
61
|
end
|
58
62
|
|
59
63
|
def regexp(pattern)
|
64
|
+
pattern = pattern.to_s
|
65
|
+
|
60
66
|
regex_body = pattern.gsub('.', '\.')
|
67
|
+
.gsub('+') { '\+' }
|
61
68
|
.gsub('?', '.')
|
62
69
|
.gsub('*', '.*')
|
63
70
|
.gsub('(', '\(')
|
64
71
|
.gsub(')', '\)')
|
65
72
|
.gsub('$', '\$')
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
73
|
+
|
74
|
+
# This matches nested braces and attempts to do something correct most of the time
|
75
|
+
# There are known issues (i.e. {,*,*/*}) that cannot be resolved with out a total
|
76
|
+
# refactoring
|
77
|
+
loop do
|
78
|
+
break unless regex_body.gsub!(/(?<re>\{(?:(?>[^{}]+)|\g<re>)*\})/) do
|
79
|
+
"(#{Regexp.last_match[1][1..-2].gsub(',', '|')})"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
regex_body = regex_body.gsub(/\A\./, '(?!\.).')
|
84
|
+
|
70
85
|
/\A#{regex_body}\Z/
|
71
86
|
end
|
72
87
|
|
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: 0.
|
4
|
+
version: 0.9.0
|
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: 2016-
|
15
|
+
date: 2016-06-29 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -137,7 +137,7 @@ files:
|
|
137
137
|
- lib/fakefs/safe.rb
|
138
138
|
- lib/fakefs/spec_helpers.rb
|
139
139
|
- lib/fakefs/version.rb
|
140
|
-
homepage: https://github.com/
|
140
|
+
homepage: https://github.com/fakefs/fakefs
|
141
141
|
licenses:
|
142
142
|
- MIT
|
143
143
|
metadata: {}
|