fakefs 3.0.0 → 3.0.1
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/dir.rb +1 -1
- data/lib/fakefs/file.rb +16 -26
- data/lib/fakefs/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e08faef6f68079adb9d714e2f5b28ab19f6502f636b7cced858fc2dd8f9feca
|
4
|
+
data.tar.gz: 975d872ac50fc21b632b14c34f9b9a5bb20e2efe3ba5f5f05b98e166cd183569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b44203007feb73426b81d63f96824c0712fadc5bc08f5622d159450cdaecd6afd7b7a31c5c69ba561f221160190ae00de4c67c39b93470a27be58e522aee8001
|
7
|
+
data.tar.gz: 30c2f8c8c74e68640ba042271c40b1e4da750c71ff44432417f208378645ef5620193e44aa75225260f6fbbf7fe010d1083e578ee857baba07eb610a43a7a867
|
data/lib/fakefs/dir.rb
CHANGED
data/lib/fakefs/file.rb
CHANGED
@@ -48,6 +48,9 @@ module FakeFS
|
|
48
48
|
(RealFile.const_defined?(:SYNC) ? RealFile::SYNC : 0)
|
49
49
|
)
|
50
50
|
|
51
|
+
DEFAULT_DIR_SIZE = 64
|
52
|
+
DIR_ENTRY_SIZE = 32
|
53
|
+
|
51
54
|
def self.extname(path)
|
52
55
|
RealFile.extname(path)
|
53
56
|
end
|
@@ -90,37 +93,24 @@ module FakeFS
|
|
90
93
|
File.lstat(path).writable?
|
91
94
|
end
|
92
95
|
|
93
|
-
|
94
|
-
|
95
|
-
FileSystem.find(path)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
def self.ctime(path)
|
102
|
-
if exist?(path)
|
103
|
-
FileSystem.find(path).ctime
|
104
|
-
else
|
105
|
-
raise Errno::ENOENT
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
def self.atime(path)
|
110
|
-
if exist?(path)
|
111
|
-
FileSystem.find(path).atime
|
112
|
-
else
|
113
|
-
raise Errno::ENOENT
|
96
|
+
[:mtime, :ctime, :atime].each do |time_method|
|
97
|
+
define_singleton_method(time_method) do |path|
|
98
|
+
if (file_node = FileSystem.find(path))
|
99
|
+
file_node.send(time_method)
|
100
|
+
else
|
101
|
+
raise Errno::ENOENT, "No such file or directory - #{path}"
|
102
|
+
end
|
114
103
|
end
|
115
104
|
end
|
116
105
|
|
117
106
|
def self.utime(atime, mtime, *paths)
|
118
107
|
paths.each do |path|
|
119
|
-
|
120
|
-
|
121
|
-
|
108
|
+
file_node = FileSystem.find(path)
|
109
|
+
if file_node
|
110
|
+
file_node.atime = atime
|
111
|
+
file_node.mtime = mtime
|
122
112
|
else
|
123
|
-
raise Errno::ENOENT
|
113
|
+
raise Errno::ENOENT, "No such file or directory - #{path}"
|
124
114
|
end
|
125
115
|
end
|
126
116
|
|
@@ -129,7 +119,7 @@ module FakeFS
|
|
129
119
|
|
130
120
|
def self.size(path)
|
131
121
|
if directory?(path)
|
132
|
-
|
122
|
+
DEFAULT_DIR_SIZE + (DIR_ENTRY_SIZE * FileSystem.find(path).entries.size)
|
133
123
|
else
|
134
124
|
read(path).bytesize
|
135
125
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
@@ -9,9 +9,10 @@ authors:
|
|
9
9
|
- Jeff Hodges
|
10
10
|
- Pat Nakajima
|
11
11
|
- Brian Donovan
|
12
|
+
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2025-
|
15
|
+
date: 2025-08-03 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: bump
|
@@ -159,6 +160,7 @@ homepage: https://github.com/fakefs/fakefs
|
|
159
160
|
licenses:
|
160
161
|
- MIT
|
161
162
|
metadata: {}
|
163
|
+
post_install_message:
|
162
164
|
rdoc_options: []
|
163
165
|
require_paths:
|
164
166
|
- lib
|
@@ -173,7 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
175
|
- !ruby/object:Gem::Version
|
174
176
|
version: '0'
|
175
177
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
178
|
+
rubygems_version: 3.4.10
|
179
|
+
signing_key:
|
177
180
|
specification_version: 4
|
178
181
|
summary: A fake filesystem. Use it in your tests.
|
179
182
|
test_files: []
|