fakefs 1.2.1 → 1.2.2
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 +6 -4
- data/lib/fakefs/file.rb +1 -1
- data/lib/fakefs/fileutils.rb +2 -2
- data/lib/fakefs/pathname.rb +4 -4
- data/lib/fakefs/version.rb +1 -1
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a6b5a114927c6a04e123a9c7fb10635134bca0dcc68f7c01bddd128ba4eba50
|
4
|
+
data.tar.gz: 87e279487ecf0bfbc2f8d87660efacc0e40dc620288780957f7ed9c471ddf8dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22739a973126cde5cbe5985fa64889cd2dbed9651d979598074c580594cf2ac4f3b54850a36c8bf6480b3db16ef5085be9d828aa8ae0e71ad26031eadc70a61
|
7
|
+
data.tar.gz: c03bbc7ef81c4c3639ba42c688d86538e4cb5a36c39c0c9e79ba2da22717c7b2344f32d7d063e0190af49f3366c0162690bd44c82368c9a22b6a3e2a12fbf664
|
data/lib/fakefs/dir.rb
CHANGED
@@ -85,14 +85,14 @@ module FakeFS
|
|
85
85
|
FileSystem.delete(string)
|
86
86
|
end
|
87
87
|
|
88
|
-
def self.entries(dirname,
|
88
|
+
def self.entries(dirname, _options = nil)
|
89
89
|
_check_for_valid_file(dirname)
|
90
90
|
|
91
91
|
Dir.new(dirname).map { |file| File.basename(file) }
|
92
92
|
end
|
93
93
|
|
94
|
-
def self.children(dirname,
|
95
|
-
entries(dirname
|
94
|
+
def self.children(dirname, _options = nil)
|
95
|
+
entries(dirname) - ['.', '..']
|
96
96
|
end
|
97
97
|
|
98
98
|
def self.each_child(dirname, &_block)
|
@@ -198,7 +198,9 @@ module FakeFS
|
|
198
198
|
opts = {}
|
199
199
|
end
|
200
200
|
tmpdir, = *rest
|
201
|
-
tmpdir ||= self.tmpdir
|
201
|
+
tmpdir ||= self.tmpdir
|
202
|
+
Dir.mkdir(tmpdir) unless Dir.exist?(tmpdir)
|
203
|
+
|
202
204
|
n = nil
|
203
205
|
begin
|
204
206
|
path = File.join(tmpdir, make_tmpname(basename, n))
|
data/lib/fakefs/file.rb
CHANGED
data/lib/fakefs/fileutils.rb
CHANGED
@@ -66,11 +66,11 @@ module FakeFS
|
|
66
66
|
alias remove rm
|
67
67
|
|
68
68
|
def rm_f(list, options = {})
|
69
|
-
rm(list,
|
69
|
+
rm(list, options.merge(force: true))
|
70
70
|
end
|
71
71
|
|
72
72
|
def rm_rf(list, options = {})
|
73
|
-
rm_r(list,
|
73
|
+
rm_r(list, options.merge(force: true))
|
74
74
|
end
|
75
75
|
alias rmtree rm_rf
|
76
76
|
alias safe_unlink rm_f
|
data/lib/fakefs/pathname.rb
CHANGED
@@ -109,10 +109,10 @@ module FakeFS
|
|
109
109
|
if File::ALT_SEPARATOR
|
110
110
|
SEPARATOR_LIST = "#{Regexp.quote File::ALT_SEPARATOR}" \
|
111
111
|
"#{Regexp.quote File::SEPARATOR}".freeze
|
112
|
-
SEPARATOR_PAT = /[#{SEPARATOR_LIST}]
|
112
|
+
SEPARATOR_PAT = /[#{SEPARATOR_LIST}]/.freeze
|
113
113
|
else
|
114
114
|
SEPARATOR_LIST = (Regexp.quote File::SEPARATOR).to_s.freeze
|
115
|
-
SEPARATOR_PAT = /#{Regexp.quote File::SEPARATOR}
|
115
|
+
SEPARATOR_PAT = /#{Regexp.quote File::SEPARATOR}/.freeze
|
116
116
|
end
|
117
117
|
|
118
118
|
# Return a pathname which the extension of the basename is substituted by
|
@@ -442,9 +442,9 @@ module FakeFS
|
|
442
442
|
def chop_basename(path)
|
443
443
|
base = File.basename(path)
|
444
444
|
if /\A#{SEPARATOR_PAT}?\z/o =~ base
|
445
|
-
|
445
|
+
nil
|
446
446
|
else
|
447
|
-
|
447
|
+
[path[0, path.rindex(base)], base]
|
448
448
|
end
|
449
449
|
end
|
450
450
|
|
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.2.
|
4
|
+
version: 1.2.2
|
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: 2020-04-
|
15
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|
@@ -29,33 +29,19 @@ dependencies:
|
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 0.5.3
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
|
-
name:
|
32
|
+
name: maxitest
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - "~>"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
37
|
+
version: '3.6'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: '
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
|
-
name: minitest-rg
|
47
|
-
requirement: !ruby/object:Gem::Requirement
|
48
|
-
requirements:
|
49
|
-
- - "~>"
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: '5.1'
|
52
|
-
type: :development
|
53
|
-
prerelease: false
|
54
|
-
version_requirements: !ruby/object:Gem::Requirement
|
55
|
-
requirements:
|
56
|
-
- - "~>"
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version: '5.1'
|
44
|
+
version: '3.6'
|
59
45
|
- !ruby/object:Gem::Dependency
|
60
46
|
name: rake
|
61
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,14 +76,14 @@ dependencies:
|
|
90
76
|
requirements:
|
91
77
|
- - "~>"
|
92
78
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.
|
79
|
+
version: 0.82.0
|
94
80
|
type: :development
|
95
81
|
prerelease: false
|
96
82
|
version_requirements: !ruby/object:Gem::Requirement
|
97
83
|
requirements:
|
98
84
|
- - "~>"
|
99
85
|
- !ruby/object:Gem::Version
|
100
|
-
version: 0.
|
86
|
+
version: 0.82.0
|
101
87
|
description: A fake filesystem. Use it in your tests.
|
102
88
|
email:
|
103
89
|
- chris@ozmm.org
|
@@ -136,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
122
|
requirements:
|
137
123
|
- - ">="
|
138
124
|
- !ruby/object:Gem::Version
|
139
|
-
version: 2.
|
125
|
+
version: 2.4.0
|
140
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
127
|
requirements:
|
142
128
|
- - ">="
|