fakefs 1.4.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fakefs/file.rb +8 -3
- data/lib/fakefs/pathname.rb +1 -1
- data/lib/fakefs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b7775639de5dd946511be2f689f5324dc1cf034e28362436f689f3eeae1f3bb
|
4
|
+
data.tar.gz: 12453961b0a4147f1fea3c78ce18419231b38df8a61bb50f092b5e70046f123c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89171de1c1f110b40772c1557ce7901fde5acd1ceda671e8afca40fe268ef773ce2ae7e13a5cb0160fa81318b07656d298d2ec910ea5a980016878f553d662a0
|
7
|
+
data.tar.gz: 1cae8466c1f3cebed996c1b66f0c24dc6bc2aef5365903cab05fe37f9ce46a1a6763ebae80a65fb198173068cb9ff19bcde0cc76430cf8e99b9ac0c58d4b1ea2
|
data/lib/fakefs/file.rb
CHANGED
@@ -174,8 +174,8 @@ module FakeFS
|
|
174
174
|
RealFile.basename(*args)
|
175
175
|
end
|
176
176
|
|
177
|
-
def self.dirname(
|
178
|
-
RealFile.dirname(
|
177
|
+
def self.dirname(*args)
|
178
|
+
RealFile.dirname(*args)
|
179
179
|
end
|
180
180
|
|
181
181
|
def self.readlink(path)
|
@@ -331,6 +331,11 @@ module FakeFS
|
|
331
331
|
File.read(file, length, offset, mode: 'rb:ASCII-8BIT')
|
332
332
|
end
|
333
333
|
|
334
|
+
def self.binwrite(file, content, offset = nil)
|
335
|
+
mode = offset ? 'r+b:ASCII-8BIT' : 'wb:ASCII-8BIT'
|
336
|
+
File.write(file, content, offset, mode: mode)
|
337
|
+
end
|
338
|
+
|
334
339
|
def self.fnmatch?(pattern, path, flags = 0)
|
335
340
|
RealFile.fnmatch?(pattern, path, flags)
|
336
341
|
end
|
@@ -658,7 +663,7 @@ module FakeFS
|
|
658
663
|
|
659
664
|
def self.write(filename, contents, offset = nil, open_args = {})
|
660
665
|
offset, open_args = nil, offset if offset.is_a?(Hash)
|
661
|
-
mode = offset ? '
|
666
|
+
mode = offset ? 'r+' : 'w'
|
662
667
|
if open_args.any?
|
663
668
|
if open_args[:open_args]
|
664
669
|
args = [filename, *open_args[:open_args]]
|
data/lib/fakefs/pathname.rb
CHANGED
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.5.1
|
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:
|
15
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.1.6
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: A fake filesystem. Use it in your tests.
|