1
0
Fork 0
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:
nobu 2017-05-29 07:03:11 +00:00
parent e0b0b923c6
commit 83ddb7c182

View file

@ -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