fakefs 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fakefs/dir.rb +19 -6
- data/lib/fakefs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac7a61d1e3f94ffbd8bf9e02b2bc067756d9a2ec5b6dedd9dd4591c014e86ddc
|
4
|
+
data.tar.gz: 849724752e1833ab9876f538910789178d78e20880be8803eb0bac0fd8f1f873
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97c55be8f221b42ab6c3cb9e80ba1531f984b8c28d565f96ab6deef78dccfe2f822cfc163ffe3108d0e915903290e793b5fe58513e7ef7ffa7af732407242eb1
|
7
|
+
data.tar.gz: 749aa9b67e909e40a6eec857c0be44faa915fbb09d30066a0387be9692860053d393922582f601de9cde3955e999b329d1febec4fadba7fc9ef0eb0c700bf8d8
|
data/lib/fakefs/dir.rb
CHANGED
@@ -37,6 +37,10 @@ module FakeFS
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
def children
|
41
|
+
each.to_a
|
42
|
+
end
|
43
|
+
|
40
44
|
def pos
|
41
45
|
@pointer
|
42
46
|
end
|
@@ -96,9 +100,11 @@ module FakeFS
|
|
96
100
|
end
|
97
101
|
|
98
102
|
def self.each_child(dirname, &_block)
|
99
|
-
Dir.open(dirname) do |
|
100
|
-
|
101
|
-
|
103
|
+
Dir.open(dirname) do |dir|
|
104
|
+
dir.each do |file|
|
105
|
+
next if ['.', '..'].include?(file)
|
106
|
+
yield file
|
107
|
+
end
|
102
108
|
end
|
103
109
|
end
|
104
110
|
|
@@ -114,7 +120,11 @@ module FakeFS
|
|
114
120
|
end
|
115
121
|
|
116
122
|
def self.foreach(dirname, &_block)
|
117
|
-
Dir.open(dirname)
|
123
|
+
Dir.open(dirname) do |dir|
|
124
|
+
dir.each do |file|
|
125
|
+
yield file
|
126
|
+
end
|
127
|
+
end
|
118
128
|
end
|
119
129
|
|
120
130
|
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, &block) # rubocop:disable Lint/UnderscorePrefixedVariableName
|
@@ -152,10 +162,13 @@ module FakeFS
|
|
152
162
|
end
|
153
163
|
|
154
164
|
def self.open(string, &_block)
|
165
|
+
dir = Dir.new(string)
|
155
166
|
if block_given?
|
156
|
-
|
167
|
+
result = yield(dir)
|
168
|
+
dir.close
|
169
|
+
result
|
157
170
|
else
|
158
|
-
|
171
|
+
dir
|
159
172
|
end
|
160
173
|
end
|
161
174
|
|
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: 2.
|
4
|
+
version: 2.2.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: 2023-02-
|
15
|
+
date: 2023-02-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|