FIX if dst cannot be deleted, it's an error

This commit is contained in:
Max Howell committed 2009-08-10 23:41:47 +01:00
1 parent 241d1d498f
commit ea2f9bbc79
1 file changed
+1 -1
+1 -1
View File
@@ -26,7 +26,7 @@ class Pathname
def rename newname
raise unless file?
dst=dirname+newname
dst.unlink rescue nil
dst.unlink if dst.exist?
mv dst
end