mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix up r58952
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): rescue File.stat when the target does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e0b0b923c6
commit
83ddb7c182
1 changed files with 3 additions and 3 deletions
|
@ -17,12 +17,12 @@ class Object
|
|||
parts.each do |part|
|
||||
name = File.join name, part
|
||||
|
||||
stat = File.stat name
|
||||
if stat.file?
|
||||
stat = File.stat name rescue nil
|
||||
if stat and stat.file?
|
||||
raise ArgumentError, "path component of #{path} is a file"
|
||||
end
|
||||
|
||||
unless stat.directory?
|
||||
unless stat and stat.directory?
|
||||
begin
|
||||
Dir.mkdir name
|
||||
rescue Errno::EEXIST
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue