ruby-changes:46838
From: nobu <ko1@a...>
Date: Mon, 29 May 2017 16:03:16 +0900 (JST)
Subject: [ruby-changes:46838] nobu:r58953 (trunk): fix up r58952
nobu 2017-05-29 16:03:11 +0900 (Mon, 29 May 2017) New Revision: 58953 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58953 Log: fix up r58952 * spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): rescue File.stat when the target does not exist. Modified files: trunk/spec/mspec/lib/mspec/helpers/fs.rb Index: spec/mspec/lib/mspec/helpers/fs.rb =================================================================== --- spec/mspec/lib/mspec/helpers/fs.rb (revision 58952) +++ spec/mspec/lib/mspec/helpers/fs.rb (revision 58953) @@ -17,12 +17,12 @@ class Object https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers/fs.rb#L17 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/