aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-08-10 16:33:15 +0100
committerMax Howell2009-08-10 16:33:15 +0100
commit3cf869385ef01997c53fbb752f87001978b487a9 (patch)
tree74a9177e764a6cd915a078f1369e5e0a525f7f59
parentb32d2044c599db400b3332fef09f4008c813c58d (diff)
downloadbrew-3cf869385ef01997c53fbb752f87001978b487a9.tar.bz2
FIX Pathname.rename
Rename relative to self.dirname
-rw-r--r--Library/Homebrew/pathname+yeast.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb
index 75eb98bba..a60ce4bd3 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 <http://www.gnu.org/licenses/>.
-
+#
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