fakefs 0.11.3 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fakefs/dir.rb +11 -0
- data/lib/fakefs/file.rb +6 -0
- data/lib/fakefs/file_test.rb +10 -0
- data/lib/fakefs/pathname.rb +12 -0
- data/lib/fakefs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09643c4a4c819c9be5e231605189c97ef45cb91
|
4
|
+
data.tar.gz: 284b16d9e2b824ded282f59e5063572eb7138434
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97da5905b26ec724ec3be99ff03f11a4ab535c98b687e1a5ec1dc53eb9a0780127ede82c8c9920eef215d50b94e333da8907805b8dac0dfdc386a7193cbf62a7
|
7
|
+
data.tar.gz: aa27617f51c8fb48be3a460c2c931fd32aa083ab5dbd2f96c24bdfc687b56345019950c5bcf70356cd3456086edac48702a097d9f4e35478438bdd354d655862
|
data/lib/fakefs/dir.rb
CHANGED
@@ -90,6 +90,17 @@ module FakeFS
|
|
90
90
|
Dir.new(dirname).map { |file| File.basename(file) }
|
91
91
|
end
|
92
92
|
|
93
|
+
if RUBY_VERSION >= '2.4'
|
94
|
+
def self.empty?(dirname)
|
95
|
+
_check_for_valid_file(dirname)
|
96
|
+
if File.directory?(dirname)
|
97
|
+
Dir.new(dirname).count <= 2
|
98
|
+
else
|
99
|
+
false
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
93
104
|
def self.foreach(dirname, &_block)
|
94
105
|
Dir.open(dirname) { |file| yield file }
|
95
106
|
end
|
data/lib/fakefs/file.rb
CHANGED
data/lib/fakefs/file_test.rb
CHANGED
data/lib/fakefs/pathname.rb
CHANGED
@@ -1019,6 +1019,18 @@ module FakeFS
|
|
1019
1019
|
end
|
1020
1020
|
|
1021
1021
|
alias_method :delete, :unlink
|
1022
|
+
|
1023
|
+
if RUBY_VERSION > '2.4'
|
1024
|
+
# Checks if a file or directory is empty, using
|
1025
|
+
# <tt>FileTest.empty?</tt> or <tt>Dir.empty?</tt> as necessary.
|
1026
|
+
def empty?
|
1027
|
+
if File.directory? @path
|
1028
|
+
Dir.empty? @path
|
1029
|
+
else
|
1030
|
+
FileTest.empty? @path
|
1031
|
+
end
|
1032
|
+
end
|
1033
|
+
end
|
1022
1034
|
end
|
1023
1035
|
|
1024
1036
|
# Pathname class
|
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: 0.
|
4
|
+
version: 0.12.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:
|
15
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.6.14
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: A fake filesystem. Use it in your tests.
|