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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e62fc76c0ca1c48b09e7b4051d5888a3f361b7f6e72434275bf3820d972c05d0
4
- data.tar.gz: fc2e3377b5948b04302f06893fd4b961311699c597dfe431a9ab04046b488d67
3
+ metadata.gz: 9b7775639de5dd946511be2f689f5324dc1cf034e28362436f689f3eeae1f3bb
4
+ data.tar.gz: 12453961b0a4147f1fea3c78ce18419231b38df8a61bb50f092b5e70046f123c
5
5
  SHA512:
6
- metadata.gz: 3c43a34b04c1d010a783da8646dfff11d50892a15faa5660730e9d284b046dfdf921adbcaff550ca0b2a25bbc5537060b457f37e11c7d64aa6bb7271cd8975ae
7
- data.tar.gz: e0523fab127204c4400921d2e1bc6bdbf8ed6c61b8c731707d92b8fa916e1c7320290c18546168bee757888dfd2ae3ad5953cb1b55557e9e5f40997428cb66d4
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(path)
178
- RealFile.dirname(path)
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 ? '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]]
@@ -1035,6 +1035,6 @@ module FakeFS
1035
1035
 
1036
1036
  # Pathname class
1037
1037
  class Pathname
1038
- undef =~
1038
+ undef =~ if respond_to?(:=~)
1039
1039
  end
1040
1040
  end
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '1.4.0'.freeze
4
+ VERSION = '1.5.1'.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.0
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: 2021-10-21 00:00:00.000000000 Z
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.2.16
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.