aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/pathname+yeast.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2009-08-11 12:20:55 -0700
committerMax Howell2009-08-24 01:03:23 +0100
commit0eaf4bbcd9e4afb8a92a678ee072e8167e841527 (patch)
tree914109b77c2bfe864165521c2af84e26953dc27c /Library/Homebrew/pathname+yeast.rb
parent65e1419ea977c6ea1f4edd6ebf24f48c84fa0832 (diff)
downloadbrew-0eaf4bbcd9e4afb8a92a678ee072e8167e841527.tar.bz2
Factor out downloading from Formula
This patch adds a ArchiveDownloadStrategy that handles downloading tarbarlls and decompressing them into the staging area ready for brewing. Refactored safe_system and curl into utils.rb Signed-off-by: Max Howell <max@methylblue.com> Modifications to Adam's original patch: I reverted objectification of checksum verification because I couldn't think of any other download validation methods that might be useful to us in the future, so allowing such flexibility had no advantages. If we ever need this to be OO we can add it. But for now less complexity is preferable. I removed the @svnurl class member. Instead download_strategy is autodetected by examining the url. The user can override the download_strategy in case this fails. Thus we already can easily add support for clones of git repositories.
Diffstat (limited to 'Library/Homebrew/pathname+yeast.rb')
-rw-r--r--Library/Homebrew/pathname+yeast.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb
index dffbb0244..f0ca0f503 100644
--- a/Library/Homebrew/pathname+yeast.rb
+++ b/Library/Homebrew/pathname+yeast.rb
@@ -22,11 +22,10 @@ class Pathname
def mv dst
FileUtils.mv to_s, dst
end
-
+
def rename newname
- raise unless file?
dst=dirname+newname
- dst.unlink if dst.exist?
+ dst.unlink if dst.exist? and file?
mv dst
end