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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e08faef6f68079adb9d714e2f5b28ab19f6502f636b7cced858fc2dd8f9feca
4
- data.tar.gz: 975d872ac50fc21b632b14c34f9b9a5bb20e2efe3ba5f5f05b98e166cd183569
3
+ metadata.gz: f14140aa5850811100ff24413b0a292776d556fd3db295751d9c2cd09ec6ea7e
4
+ data.tar.gz: 7fd749e6975091c8c76334f0231ad4f7934c258bf110dc48b9fdda997b6038e9
5
5
  SHA512:
6
- metadata.gz: b44203007feb73426b81d63f96824c0712fadc5bc08f5622d159450cdaecd6afd7b7a31c5c69ba561f221160190ae00de4c67c39b93470a27be58e522aee8001
7
- data.tar.gz: 30c2f8c8c74e68640ba042271c40b1e4da750c71ff44432417f208378645ef5620193e44aa75225260f6fbbf7fe010d1083e578ee857baba07eb610a43a7a867
6
+ metadata.gz: 71a73c4fdff9e06aed5eb192c659cff61c0eb61807ecf5d32a314e5e3a44eb47cf9c0c81322d2e49e5a1ea068518070197c605d1c2d8504e1f77dbe15ac6080b
7
+ data.tar.gz: c4fd74ecdf5cd6ef114948086ae27ac43b74063e51e7e5c430a9f1e0c3dd5ef5064b384c6c3ac6472c933363b80394c23c4699debb33fce5090ba8d4f329f478
@@ -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[-2..-1] == '/.'
167
- dir.entries.each { |f| new_dir[f.name] = f.clone(new_dir) }
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
- new_dir[dir.name] = dir.entry.clone(new_dir)
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
- FileSystem.add(dest, dir.entry.clone)
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
@@ -3,7 +3,7 @@
3
3
  module FakeFS
4
4
  # Version module
5
5
  module Version
6
- VERSION = '3.0.1'
6
+ VERSION = '3.0.2'
7
7
 
8
8
  def self.to_s
9
9
  VERSION
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.1
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-03 00:00:00.000000000 Z
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.0.0
185
+ version: 3.2.0
172
186
  required_rubygems_version: !ruby/object:Gem::Requirement
173
187
  requirements:
174
188
  - - ">="