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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d66d45ce395ac98a16475005c6dcb2bea65987d13f035ca6fba22b891c49ed85
4
- data.tar.gz: b08159da06da614fbc5250e462deee6908bd11c66bbf349bc4476c60c20652af
3
+ metadata.gz: 40d4541c1e96d0f597282271a3c74fc77afa2bd65ede24103e9ad1cd6f4ab1ab
4
+ data.tar.gz: d8425d59d90519c42064560ebf8ac7db31a550e8860d8203c506f1dbb6458543
5
5
  SHA512:
6
- metadata.gz: 43041ad7acafb77fedfef6357953fc45bb9eead99eba2806aa7c5e350b3e647f09e36b53d3b974dfd96daaf36721d3d1c437917131f0e07fd14de8731b0df79f
7
- data.tar.gz: 0064c6914fd6df796be81324820d5700f711388297c72164eefc16f65de4ff827c9f1f014c4040bd79cc4e356cf0c277301581522195d0ab9500e41393b2298d
6
+ metadata.gz: 4e9db54213ee052f1ce47bb36ecff07c53636449d8a0e88d73cbc97c8f1e1920d5f5983004afea4b7375e5c5e6bcbb76fbf9b29a30df5e82e6b1164d59e0fa06
7
+ data.tar.gz: b63d8b29758a21a9e85bf3fe1d7deb05cae1eb4175f236c1e6a4e1e9826f0bd24922ebeb5c80d98fe9bd9fa78910d176ca81955c95fadc4c04c421b0f78f54e3
@@ -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
- if $SAFE > 0 && tmpdir.tainted?
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, *opts)
205
+ yield(path, n, **opts)
211
206
  rescue Errno::EEXIST
212
207
  n ||= 0
213
208
  n += 1
@@ -690,7 +690,11 @@ module FakeFS
690
690
 
691
691
  def read(length = nil, buf = '')
692
692
  read_buf = super(length, buf)
693
- read_buf&.force_encoding('ASCII-8BIT') if binary_mode?
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
 
@@ -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
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '1.0.0'.freeze
4
+ VERSION = '1.1.0'.freeze
5
5
 
6
6
  def self.to_s
7
7
  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: 1.0.0
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-01-10 00:00:00.000000000 Z
15
+ date: 2020-03-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bump