fakefs 1.1.0 → 1.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/base.rb +1 -1
- data/lib/fakefs/dir.rb +2 -2
- data/lib/fakefs/file.rb +3 -3
- data/lib/fakefs/fileutils.rb +5 -5
- data/lib/fakefs/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b44fd4b36d76a0fd4201c8d65438b10f916e19ad111b857f1b4b83269c3a3911
|
4
|
+
data.tar.gz: 9c2ae1a1a131116c1aac45e4bac9791a55c430862dc24d85c97053656ecea050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d092e26a0b3ac14a75807243fae5d5e297fed1b24884182553fc5cd8b943cb867e73aac2a16c461abe2279db1102190b94db33120b0292560ad768037c319ab
|
7
|
+
data.tar.gz: e73736a37d2b9476af943802b4496d751c1aba4a6ba9ce20aca77cbed665a2ddd9e294e95d89b07c180addfc4c3c54e895afd04538f39d8cda538f4faa6b66c6
|
data/lib/fakefs/base.rb
CHANGED
data/lib/fakefs/dir.rb
CHANGED
@@ -92,7 +92,7 @@ module FakeFS
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def self.children(dirname, opts = {})
|
95
|
-
entries(dirname, opts) - ['.', '..']
|
95
|
+
entries(dirname, **opts) - ['.', '..']
|
96
96
|
end
|
97
97
|
|
98
98
|
def self.each_child(dirname, &_block)
|
@@ -202,7 +202,7 @@ module FakeFS
|
|
202
202
|
n = nil
|
203
203
|
begin
|
204
204
|
path = File.join(tmpdir, make_tmpname(basename, n))
|
205
|
-
yield(path, n,
|
205
|
+
yield(path, n, opts)
|
206
206
|
rescue Errno::EEXIST
|
207
207
|
n ||= 0
|
208
208
|
n += 1
|
data/lib/fakefs/file.rb
CHANGED
@@ -183,7 +183,7 @@ module FakeFS
|
|
183
183
|
options = args[-1].is_a?(Hash) ? args.pop : {}
|
184
184
|
length = args.empty? ? nil : args.shift
|
185
185
|
offset = args.empty? ? 0 : args.shift
|
186
|
-
file = new(path, options)
|
186
|
+
file = new(path, **options)
|
187
187
|
|
188
188
|
raise Errno::ENOENT unless file.exists?
|
189
189
|
raise Errno::EISDIR, path.to_s if directory?(path)
|
@@ -497,8 +497,8 @@ module FakeFS
|
|
497
497
|
true
|
498
498
|
end
|
499
499
|
|
500
|
-
def write(
|
501
|
-
val = super(
|
500
|
+
def write(*args)
|
501
|
+
val = super(*args)
|
502
502
|
@file.mtime = Time.now
|
503
503
|
val
|
504
504
|
end
|
data/lib/fakefs/fileutils.rb
CHANGED
@@ -66,11 +66,11 @@ module FakeFS
|
|
66
66
|
alias remove rm
|
67
67
|
|
68
68
|
def rm_f(list, options = {})
|
69
|
-
rm(list, options.merge(force: true))
|
69
|
+
rm(list, **options.merge(force: true))
|
70
70
|
end
|
71
71
|
|
72
72
|
def rm_rf(list, options = {})
|
73
|
-
rm_r(list, options.merge(force: true))
|
73
|
+
rm_r(list, **options.merge(force: true))
|
74
74
|
end
|
75
75
|
alias rmtree rm_rf
|
76
76
|
alias safe_unlink rm_f
|
@@ -103,7 +103,7 @@ module FakeFS
|
|
103
103
|
raise Errno::ENOENT, dest.to_s unless File.exist?(dest) || File.exist?(File.dirname(dest))
|
104
104
|
|
105
105
|
# handle `verbose' flag
|
106
|
-
RealFileUtils.cp src, dest, options.merge(noop: true)
|
106
|
+
RealFileUtils.cp src, dest, **options.merge(noop: true)
|
107
107
|
|
108
108
|
# handle `noop' flag
|
109
109
|
return if options[:noop]
|
@@ -145,7 +145,7 @@ module FakeFS
|
|
145
145
|
|
146
146
|
def cp_r(src, dest, options = {})
|
147
147
|
# handle `verbose' flag
|
148
|
-
RealFileUtils.cp_r src, dest, options.merge(noop: true)
|
148
|
+
RealFileUtils.cp_r src, dest, **options.merge(noop: true)
|
149
149
|
|
150
150
|
# handle `noop' flag
|
151
151
|
return if options[:noop]
|
@@ -176,7 +176,7 @@ module FakeFS
|
|
176
176
|
|
177
177
|
def mv(src, dest, options = {})
|
178
178
|
# handle `verbose' flag
|
179
|
-
RealFileUtils.mv src, dest, options.merge(noop: true)
|
179
|
+
RealFileUtils.mv src, dest, **options.merge(noop: true)
|
180
180
|
|
181
181
|
# handle `noop' flag
|
182
182
|
return if options[:noop]
|
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: 1.
|
4
|
+
version: 1.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: 2020-03-
|
15
|
+
date: 2020-03-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|
@@ -60,14 +60,14 @@ dependencies:
|
|
60
60
|
name: rake
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- - "
|
63
|
+
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '10.3'
|
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
72
|
version: '10.3'
|
73
73
|
- !ruby/object:Gem::Dependency
|