diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index c089c4ee5e3a1b6eaad3b38f6ceea3d7086c045e..f9409f7604f71039e171f91a195a6e16d364c33c 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