fakefs 3.0.4 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fakefs/dir.rb +6 -8
- data/lib/fakefs/file.rb +2 -4
- data/lib/fakefs/file_test.rb +2 -4
- data/lib/fakefs/pathname.rb +18 -9
- data/lib/fakefs/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93a5fc407e444a83d352f6b73e7bab7dae46d134ef8082d4ab46ff8db8796601
|
|
4
|
+
data.tar.gz: 9d99e83ce9aac58f9f11361d9e55dacccc29fcd2449c20b0ccbf3375094cd06e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54f3fdd244ed9320c59a6c8d4177d1fe02545b60469559bd058b30f6bc765fb834043a00d2a008eaea0a87a5de37a4b70400a041c0421863066f75978ad60a5d
|
|
7
|
+
data.tar.gz: 828681a8a58732c78b76241234f087fe3546366381a6443ce22862b57727ff46932ab3e8724240b0287fd8c817b4b8250730a27497a0745d15742f9420e69cd0
|
data/lib/fakefs/dir.rb
CHANGED
|
@@ -110,14 +110,12 @@ module FakeFS
|
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
false
|
|
120
|
-
end
|
|
113
|
+
def self.empty?(dirname)
|
|
114
|
+
_check_for_valid_file(dirname)
|
|
115
|
+
if File.directory?(dirname)
|
|
116
|
+
Dir.new(dirname).count <= 2
|
|
117
|
+
else
|
|
118
|
+
false
|
|
121
119
|
end
|
|
122
120
|
end
|
|
123
121
|
|
data/lib/fakefs/file.rb
CHANGED
data/lib/fakefs/file_test.rb
CHANGED
data/lib/fakefs/pathname.rb
CHANGED
|
@@ -438,6 +438,12 @@ module FakeFS
|
|
|
438
438
|
end
|
|
439
439
|
end
|
|
440
440
|
|
|
441
|
+
protected
|
|
442
|
+
|
|
443
|
+
def path
|
|
444
|
+
to_s
|
|
445
|
+
end
|
|
446
|
+
|
|
441
447
|
private
|
|
442
448
|
|
|
443
449
|
# chop_basename(path) -> [pre-basename, basename] or nil
|
|
@@ -637,6 +643,11 @@ module FakeFS
|
|
|
637
643
|
File.binread(@path, *args)
|
|
638
644
|
end
|
|
639
645
|
|
|
646
|
+
# See <tt>File.binwrite</tt>. Returns the number of bytes written.
|
|
647
|
+
def binwrite(string, *args)
|
|
648
|
+
File.binwrite(@path, string, *args)
|
|
649
|
+
end
|
|
650
|
+
|
|
640
651
|
# See <tt>IO.readlines</tt>. Returns all the lines from the file.
|
|
641
652
|
def readlines(*args)
|
|
642
653
|
File.readlines(@path, *args)
|
|
@@ -1023,15 +1034,13 @@ module FakeFS
|
|
|
1023
1034
|
|
|
1024
1035
|
alias delete unlink
|
|
1025
1036
|
|
|
1026
|
-
if
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
FileTest.empty? @path
|
|
1034
|
-
end
|
|
1037
|
+
# Checks if a file or directory is empty, using
|
|
1038
|
+
# <tt>FileTest.empty?</tt> or <tt>Dir.empty?</tt> as necessary.
|
|
1039
|
+
def empty?
|
|
1040
|
+
if File.directory? @path
|
|
1041
|
+
Dir.empty? @path
|
|
1042
|
+
else
|
|
1043
|
+
FileTest.empty? @path
|
|
1035
1044
|
end
|
|
1036
1045
|
end
|
|
1037
1046
|
end
|
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: 3.0
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Wanstrath
|
|
@@ -9,10 +9,9 @@ authors:
|
|
|
9
9
|
- Jeff Hodges
|
|
10
10
|
- Pat Nakajima
|
|
11
11
|
- Brian Donovan
|
|
12
|
-
autorequire:
|
|
13
12
|
bindir: bin
|
|
14
13
|
cert_chain: []
|
|
15
|
-
date:
|
|
14
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
16
15
|
dependencies:
|
|
17
16
|
- !ruby/object:Gem::Dependency
|
|
18
17
|
name: bump
|
|
@@ -174,7 +173,6 @@ homepage: https://github.com/fakefs/fakefs
|
|
|
174
173
|
licenses:
|
|
175
174
|
- MIT
|
|
176
175
|
metadata: {}
|
|
177
|
-
post_install_message:
|
|
178
176
|
rdoc_options: []
|
|
179
177
|
require_paths:
|
|
180
178
|
- lib
|
|
@@ -189,8 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
189
187
|
- !ruby/object:Gem::Version
|
|
190
188
|
version: '0'
|
|
191
189
|
requirements: []
|
|
192
|
-
rubygems_version:
|
|
193
|
-
signing_key:
|
|
190
|
+
rubygems_version: 4.0.3
|
|
194
191
|
specification_version: 4
|
|
195
192
|
summary: A fake filesystem. Use it in your tests.
|
|
196
193
|
test_files: []
|