diff options
| author | Jack Nagel | 2014-07-15 13:42:03 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-07-15 13:42:03 -0500 | 
| commit | 771bc2978c17c3164757333eb90ee59071f0c9b6 (patch) | |
| tree | 3ea670f4a95d40c3e1dfc30739ce80f9fd42e8c5 /Library/Homebrew/resource.rb | |
| parent | de42ad52a545e36b0225d5d7c4c1a96c491c642b (diff) | |
| download | brew-771bc2978c17c3164757333eb90ee59071f0c9b6.tar.bz2 | |
Eagerly set the download strategy
Diffstat (limited to 'Library/Homebrew/resource.rb')
| -rw-r--r-- | Library/Homebrew/resource.rb | 8 | 
1 files changed, 3 insertions, 5 deletions
diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 3409845a0..f8cb56e89 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -9,7 +9,8 @@ class Resource    include FileUtils    attr_reader :checksum, :mirrors, :specs, :using -  attr_writer :url, :checksum, :version, :download_strategy +  attr_writer :url, :checksum, :version +  attr_accessor :download_strategy    # Formula name must be set after the DSL, as we have no access to the    # formula name before initialization of the formula @@ -34,10 +35,6 @@ class Resource      name.nil? ? owner.name : "#{owner.name}--#{name}"    end -  def download_strategy -    @download_strategy ||= DownloadStrategyDetector.detect(url, using) -  end -    def cached_download      downloader.cached_location    end @@ -104,6 +101,7 @@ class Resource      @url = val      @specs.merge!(specs)      @using = @specs.delete(:using) +    @download_strategy = DownloadStrategyDetector.detect(url, using)    end    def version val=nil  | 
