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.
Showing
- Library/Homebrew/formula.rb 88 additions, 60 deletionsLibrary/Homebrew/formula.rb
- Library/Homebrew/pathname+yeast.rb 2 additions, 3 deletionsLibrary/Homebrew/pathname+yeast.rb
- Library/Homebrew/unittest.rb 15 additions, 11 deletionsLibrary/Homebrew/unittest.rb
- Library/Homebrew/utils.rb 14 additions, 0 deletionsLibrary/Homebrew/utils.rb
Loading
Please register or sign in to comment