diff options
| author | Jack Nagel | 2013-09-17 21:25:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-09-17 21:29:53 -0500 |
| commit | e3a3a0c320a86a02be231783dfdf79923ab53d2c (patch) | |
| tree | f8c812b2ffc0bf6687bc1a301be9ed6072cc185f /Library | |
| parent | 978f0887cb38c4437678933e63f38fb0c5e40536 (diff) | |
| download | brew-e3a3a0c320a86a02be231783dfdf79923ab53d2c.tar.bz2 | |
Reorganize resource download methods
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/resource.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index c089c4ee5..f9409f760 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -30,10 +30,21 @@ class Resource end def downloader - download_name = name == :default ? owner.name : "#{owner.name}--#{name}" @downloader ||= download_strategy.new(download_name, self) end + def download_name + name == :default ? owner.name : "#{owner.name}--#{name}" + end + + def download_strategy + @download_strategy ||= DownloadStrategyDetector.detect(url, using) + end + + def cached_download + downloader.cached_location + end + # Download the resource # If a target is given, unpack there; else unpack to a temp folder # If block is given, yield to that block @@ -51,14 +62,6 @@ class Resource end end - def download_strategy - @download_strategy ||= DownloadStrategyDetector.detect(url, using) - end - - def cached_download - downloader.cached_location - end - # For brew-fetch and others. def fetch # Ensure the cache exists |
