fakefs 1.4.1 → 1.5.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: b92c729c5ace776ebe3f2b5f396532b900f15997884de6239d67d9d41e21d16e
4
- data.tar.gz: b331cf5fcafafd27e677c96386670099998acb126fbe84beb81774ff32e04a85
3
+ metadata.gz: 825da63678bcf85ba7a0e7fdcdf067da5477187ffb2e5d982bcdae72084b8ea6
4
+ data.tar.gz: 7d860f9926de5b203041b652ff4692731dfd5c34846908c48bc02e6b853e0dd1
5
5
  SHA512:
6
- metadata.gz: 9325e6abc81df8f759d9898e0946432f7ef6f1f554d26d0d231663340f6dba9363ae1dc065a8bb91645c2d266a528002ca3be8eebece8579a0e02cba3b9b716e
7
- data.tar.gz: 94457dccf10cff791ff60061b72994143fd3bd7771d71f48a90591709a0825439c852ad166f4212616f0476bca7bbc632f00e1bc77ed64700796a0f46b90c772
6
+ metadata.gz: 649a2c7d8c39458f3c81cdaf7eade2a5203fa5b1c33ac7e243e94afbb4da4dad6029772ee708d7034b6ad70ca15549e6bbb028967a92183b4bb26780c5374b6f
7
+ data.tar.gz: cded1748b5a782e70923bf9cf3111f91cd2f06cb749db05768b2a619c884041a508e49221b2ddf775ac340bc76dd47bb26da1c397a6cd7f9b9dc99eedd22005b
data/lib/fakefs/file.rb CHANGED
@@ -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 ? 'a' : 'w'
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]]
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '1.4.1'.freeze
4
+ VERSION = '1.5.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.4.1
4
+ version: 1.5.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: 2022-01-18 00:00:00.000000000 Z
15
+ date: 2022-05-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bump