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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40d4541c1e96d0f597282271a3c74fc77afa2bd65ede24103e9ad1cd6f4ab1ab
4
- data.tar.gz: d8425d59d90519c42064560ebf8ac7db31a550e8860d8203c506f1dbb6458543
3
+ metadata.gz: b44fd4b36d76a0fd4201c8d65438b10f916e19ad111b857f1b4b83269c3a3911
4
+ data.tar.gz: 9c2ae1a1a131116c1aac45e4bac9791a55c430862dc24d85c97053656ecea050
5
5
  SHA512:
6
- metadata.gz: 4e9db54213ee052f1ce47bb36ecff07c53636449d8a0e88d73cbc97c8f1e1920d5f5983004afea4b7375e5c5e6bcbb76fbf9b29a30df5e82e6b1164d59e0fa06
7
- data.tar.gz: b63d8b29758a21a9e85bf3fe1d7deb05cae1eb4175f236c1e6a4e1e9826f0bd24922ebeb5c80d98fe9bd9fa78910d176ca81955c95fadc4c04c421b0f78f54e3
6
+ metadata.gz: 8d092e26a0b3ac14a75807243fae5d5e297fed1b24884182553fc5cd8b943cb867e73aac2a16c461abe2279db1102190b94db33120b0292560ad768037c319ab
7
+ data.tar.gz: e73736a37d2b9476af943802b4496d751c1aba4a6ba9ce20aca77cbed665a2ddd9e294e95d89b07c180addfc4c3c54e895afd04538f39d8cda538f4faa6b66c6
@@ -16,7 +16,7 @@ end
16
16
  module FakeFS
17
17
  class << self
18
18
  def activated?
19
- @activated ? true : false
19
+ @activated ||= false
20
20
  end
21
21
 
22
22
  # unconditionally activate
@@ -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, **opts)
205
+ yield(path, n, opts)
206
206
  rescue Errno::EEXIST
207
207
  n ||= 0
208
208
  n += 1
@@ -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(str)
501
- val = super(str)
500
+ def write(*args)
501
+ val = super(*args)
502
502
  @file.mtime = Time.now
503
503
  val
504
504
  end
@@ -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]
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '1.1.0'.freeze
4
+ VERSION = '1.2.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.1.0
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-20 00:00:00.000000000 Z
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