fakefs 3.0.1 → 3.0.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/fileutils.rb +24 -4
- data/lib/fakefs/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f14140aa5850811100ff24413b0a292776d556fd3db295751d9c2cd09ec6ea7e
|
4
|
+
data.tar.gz: 7fd749e6975091c8c76334f0231ad4f7934c258bf110dc48b9fdda997b6038e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71a73c4fdff9e06aed5eb192c659cff61c0eb61807ecf5d32a314e5e3a44eb47cf9c0c81322d2e49e5a1ea068518070197c605d1c2d8504e1f77dbe15ac6080b
|
7
|
+
data.tar.gz: c4fd74ecdf5cd6ef114948086ae27ac43b74063e51e7e5c430a9f1e0c3dd5ef5064b384c6c3ac6472c933363b80394c23c4699debb33fce5090ba8d4f329f478
|
data/lib/fakefs/fileutils.rb
CHANGED
@@ -160,16 +160,25 @@ module FakeFS
|
|
160
160
|
raise Errno::EEXIST, dest.to_s if new_dir && !File.directory?(dest)
|
161
161
|
raise Errno::ENOENT, dest.to_s if !new_dir && !FileSystem.find(dest.to_s + '/../')
|
162
162
|
|
163
|
+
update_times = proc { |f| f.atime = f.mtime = Time.now }
|
163
164
|
# This last bit is a total abuse and should be thought hard
|
164
165
|
# about and cleaned up.
|
165
166
|
if new_dir
|
166
|
-
if src.to_s
|
167
|
-
dir.entries.each
|
167
|
+
if src.to_s.end_with?('/.')
|
168
|
+
dir.entries.each do |f|
|
169
|
+
copy = f.clone(new_dir)
|
170
|
+
walk_hierarchy(copy, &update_times) unless options[:preserve]
|
171
|
+
new_dir[f.name] = copy
|
172
|
+
end
|
168
173
|
else
|
169
|
-
|
174
|
+
copy = dir.entry.clone(new_dir)
|
175
|
+
walk_hierarchy(copy, &update_times) unless options[:preserve]
|
176
|
+
new_dir[dir.name] = copy
|
170
177
|
end
|
171
178
|
else
|
172
|
-
|
179
|
+
copy = dir.entry.clone
|
180
|
+
walk_hierarchy(copy, &update_times) unless options[:preserve]
|
181
|
+
FileSystem.add(dest, copy)
|
173
182
|
end
|
174
183
|
end
|
175
184
|
|
@@ -305,5 +314,16 @@ module FakeFS
|
|
305
314
|
end
|
306
315
|
true
|
307
316
|
end
|
317
|
+
|
318
|
+
private
|
319
|
+
|
320
|
+
# Walks through the file system hierarchy recursively, starting from the given entry,
|
321
|
+
# and calls the given block with it.
|
322
|
+
def walk_hierarchy(entry, &block)
|
323
|
+
yield entry
|
324
|
+
if entry.is_a? FakeDir
|
325
|
+
entry.entries.each { |child| walk_hierarchy(child, &block) }
|
326
|
+
end
|
327
|
+
end
|
308
328
|
end
|
309
329
|
end
|
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: 3.0.
|
4
|
+
version: 3.0.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: 2025-08-
|
15
|
+
date: 2025-08-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|
@@ -42,6 +42,20 @@ dependencies:
|
|
42
42
|
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: irb
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
type: :development
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
45
59
|
- !ruby/object:Gem::Dependency
|
46
60
|
name: maxitest
|
47
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
182
|
requirements:
|
169
183
|
- - ">="
|
170
184
|
- !ruby/object:Gem::Version
|
171
|
-
version: 3.
|
185
|
+
version: 3.2.0
|
172
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
187
|
requirements:
|
174
188
|
- - ">="
|