From 3cf869385ef01997c53fbb752f87001978b487a9 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 10 Aug 2009 16:33:15 +0100 Subject: [PATCH] FIX Pathname.rename Rename relative to self.dirname --- Library/Homebrew/pathname+yeast.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb index 75eb98bba9..a60ce4bd32 100644 --- a/Library/Homebrew/pathname+yeast.rb +++ b/Library/Homebrew/pathname+yeast.rb @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with Homebrew. If not, see . - +# require 'pathname' # we enhance pathname to make our code more readable @@ -23,9 +23,10 @@ class Pathname FileUtils.mv to_s, dst end - def rename dst - dst=Pathname.new dst - dst.unlink if dst.exist? + def rename newname + raise unless file? + dst=dirname+newname + dst.unlink rescue nil mv dst end