fakefs 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fakefs/file_system.rb +2 -2
- data/lib/fakefs/fileutils.rb +9 -2
- data/lib/fakefs/globber.rb +6 -6
- data/lib/fakefs/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea957af228d52583f2b6aca6ed6499df8b57036a
|
4
|
+
data.tar.gz: ccf8113df4be046c382f21df104ddc5cc3bd569b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5150ca1c947b1da5a27ae7708e4bd9f2abd442ccedc5b4be9a3d6428e18828c275395caddc567b5bc6385f04ae027772c2ccee00b83474573e0d98a9a194f2ce
|
7
|
+
data.tar.gz: 42006bad3ce9c0d9a53de5ea2638ce4c6cb0d39ed8451d95c6d9cec4180598225d835952fc69fb17abd019507a740209265e45a4a0d1e891fe64f86f0a0d0eae
|
data/lib/fakefs/file_system.rb
CHANGED
@@ -90,7 +90,7 @@ module FakeFS
|
|
90
90
|
fail Errno::ENOENT, dir unless new_dir
|
91
91
|
|
92
92
|
dir_levels.push dir unless blk
|
93
|
-
|
93
|
+
yield(dir) if blk
|
94
94
|
ensure
|
95
95
|
dir_levels.pop if blk
|
96
96
|
end
|
@@ -128,7 +128,7 @@ module FakeFS
|
|
128
128
|
directories_under(dir).map do |d|
|
129
129
|
d.entries.select do |f|
|
130
130
|
(f.is_a?(FakeFile) || f.is_a?(FakeDir)) &&
|
131
|
-
|
131
|
+
f.name.match(/\A(?!\.)/)
|
132
132
|
end
|
133
133
|
end.flatten.uniq
|
134
134
|
when []
|
data/lib/fakefs/fileutils.rb
CHANGED
@@ -127,6 +127,13 @@ module FakeFS
|
|
127
127
|
cp(src, dest)
|
128
128
|
end
|
129
129
|
|
130
|
+
def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
|
131
|
+
cp_r(src, dest,
|
132
|
+
preserve: preserve,
|
133
|
+
dereference_root: dereference_root,
|
134
|
+
remove_destination: remove_destination)
|
135
|
+
end
|
136
|
+
|
130
137
|
def cp_r(src, dest, options = {})
|
131
138
|
# handle `verbose' flag
|
132
139
|
RealFileUtils.cp_r src, dest, options.merge(noop: true)
|
@@ -204,10 +211,10 @@ module FakeFS
|
|
204
211
|
list.each do |f|
|
205
212
|
if File.exist?(f)
|
206
213
|
uid = if user
|
207
|
-
user.to_s
|
214
|
+
user.to_s =~ /\d+/ ? user.to_i : Etc.getpwnam(user).uid
|
208
215
|
end
|
209
216
|
gid = if group
|
210
|
-
group.to_s
|
217
|
+
group.to_s =~ /\d+/ ? group.to_i : Etc.getgrnam(group).gid
|
211
218
|
end
|
212
219
|
File.chown(uid, gid, f)
|
213
220
|
else
|
data/lib/fakefs/globber.rb
CHANGED
@@ -64,12 +64,12 @@ module FakeFS
|
|
64
64
|
pattern = pattern.to_s
|
65
65
|
|
66
66
|
regex_body = pattern.gsub('.', '\.')
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
67
|
+
.gsub('+') { '\+' }
|
68
|
+
.gsub('?', '.')
|
69
|
+
.gsub('*', '.*')
|
70
|
+
.gsub('(', '\(')
|
71
|
+
.gsub(')', '\)')
|
72
|
+
.gsub('$', '\$')
|
73
73
|
|
74
74
|
# This matches nested braces and attempts to do something correct most of the time
|
75
75
|
# There are known issues (i.e. {,*,*/*}) that cannot be resolved with out a total
|
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.9.
|
4
|
+
version: 0.9.3
|
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-10-
|
15
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -62,14 +62,14 @@ dependencies:
|
|
62
62
|
requirements:
|
63
63
|
- - "~>"
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
65
|
+
version: 0.41.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 0.
|
72
|
+
version: 0.41.2
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: bump
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|