From eebb06165f56fc316b03fbd6734a513eb05a96ac Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 15 May 2005 05:50:45 +0000 Subject: * lib/pathname.rb (Pathname#unlink): unlink a symlink to a directory was failed. [ruby-core:4992] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pathname.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/pathname.rb') diff --git a/lib/pathname.rb b/lib/pathname.rb index be1cb29b43..83f517d49e 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -868,10 +868,10 @@ class Pathname # * mixed * # Removes a file or directory, using File.unlink or # Dir.unlink as necessary. def unlink() - if FileTest.directory? @path - Dir.unlink @path - else + begin File.unlink @path + rescue Errno::EISDIR + Dir.unlink @path end end alias delete unlink -- cgit v1.2.3