fakefs 1.0.0 → 1.1.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 +3 -8
- data/lib/fakefs/file.rb +5 -1
- data/lib/fakefs/pathname.rb +0 -14
- 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: 40d4541c1e96d0f597282271a3c74fc77afa2bd65ede24103e9ad1cd6f4ab1ab
|
4
|
+
data.tar.gz: d8425d59d90519c42064560ebf8ac7db31a550e8860d8203c506f1dbb6458543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e9db54213ee052f1ce47bb36ecff07c53636449d8a0e88d73cbc97c8f1e1920d5f5983004afea4b7375e5c5e6bcbb76fbf9b29a30df5e82e6b1164d59e0fa06
|
7
|
+
data.tar.gz: b63d8b29758a21a9e85bf3fe1d7deb05cae1eb4175f236c1e6a4e1e9826f0bd24922ebeb5c80d98fe9bd9fa78910d176ca81955c95fadc4c04c421b0f78f54e3
|
data/lib/fakefs/dir.rb
CHANGED
@@ -194,20 +194,15 @@ module FakeFS
|
|
194
194
|
if (opts = Hash.try_convert(rest[-1]))
|
195
195
|
opts = opts.dup if rest.pop.equal?(opts)
|
196
196
|
max_try = opts.delete(:max_try)
|
197
|
-
opts = [opts]
|
198
197
|
else
|
199
|
-
opts =
|
198
|
+
opts = {}
|
200
199
|
end
|
201
200
|
tmpdir, = *rest
|
202
|
-
|
203
|
-
tmpdir = '/tmp'
|
204
|
-
else
|
205
|
-
tmpdir ||= self.tmpdir
|
206
|
-
end
|
201
|
+
tmpdir ||= self.tmpdir # rubocop:disable Style/RedundantSelf
|
207
202
|
n = nil
|
208
203
|
begin
|
209
204
|
path = File.join(tmpdir, make_tmpname(basename, n))
|
210
|
-
yield(path, n,
|
205
|
+
yield(path, n, **opts)
|
211
206
|
rescue Errno::EEXIST
|
212
207
|
n ||= 0
|
213
208
|
n += 1
|
data/lib/fakefs/file.rb
CHANGED
@@ -690,7 +690,11 @@ module FakeFS
|
|
690
690
|
|
691
691
|
def read(length = nil, buf = '')
|
692
692
|
read_buf = super(length, buf)
|
693
|
-
|
693
|
+
if binary_mode?
|
694
|
+
read_buf&.force_encoding('ASCII-8BIT')
|
695
|
+
else
|
696
|
+
read_buf&.force_encoding(Encoding.default_external)
|
697
|
+
end
|
694
698
|
read_buf
|
695
699
|
end
|
696
700
|
|
data/lib/fakefs/pathname.rb
CHANGED
@@ -36,8 +36,6 @@ module FakeFS
|
|
36
36
|
if /\0/ =~ @path
|
37
37
|
raise ArgumentError, "pathname contains \\0: #{@path.inspect}"
|
38
38
|
end
|
39
|
-
|
40
|
-
taint if @path.tainted?
|
41
39
|
end
|
42
40
|
|
43
41
|
def freeze
|
@@ -46,18 +44,6 @@ module FakeFS
|
|
46
44
|
self
|
47
45
|
end
|
48
46
|
|
49
|
-
def taint
|
50
|
-
super
|
51
|
-
@path.taint
|
52
|
-
self
|
53
|
-
end
|
54
|
-
|
55
|
-
def untaint
|
56
|
-
super
|
57
|
-
@path.untaint
|
58
|
-
self
|
59
|
-
end
|
60
|
-
|
61
47
|
#
|
62
48
|
# Compare this pathname with +other+. The comparison is string-based.
|
63
49
|
# Be aware that two different paths
|
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.1.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-
|
15
|
+
date: 2020-03-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|