diff options
| author | Adam Vandenberg | 2009-08-11 12:20:55 -0700 |
|---|---|---|
| committer | Max Howell | 2009-08-24 01:03:23 +0100 |
| commit | 0eaf4bbcd9e4afb8a92a678ee072e8167e841527 (patch) | |
| tree | 914109b77c2bfe864165521c2af84e26953dc27c /Library/Homebrew/pathname+yeast.rb | |
| parent | 65e1419ea977c6ea1f4edd6ebf24f48c84fa0832 (diff) | |
| download | brew-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.rb | 5 |
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 |
