aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-12-05 22:11:23 -0500
committerJack Nagel2014-12-05 22:11:23 -0500
commitaad426f591a23edd8e98c20577a10fc1864de98c (patch)
treec6e4fbebc5b700e1d3384007e2cae61ad91d35cd /Library/Homebrew
parent8184b8a8915dd968204bda5de6fbe49090ac4c3e (diff)
downloadhomebrew-aad426f591a23edd8e98c20577a10fc1864de98c.tar.bz2
CurlDownloadStrategy: initialize attributes in initializer
The downloader is instantiated on-demand, so we no longer need the lazy initialization here.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/download_strategy.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index d3b72e09a..7d6aca1bc 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -73,16 +73,13 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
end
class CurlDownloadStrategy < AbstractDownloadStrategy
- def mirrors
- @mirrors ||= resource.mirrors.dup
- end
-
- def tarball_path
- @tarball_path ||= Pathname.new("#{HOMEBREW_CACHE}/#{name}-#{resource.version}#{ext}")
- end
+ attr_reader :mirrors, :tarball_path, :temporary_path
- def temporary_path
- @temporary_path ||= Pathname.new("#{tarball_path}.incomplete")
+ def initialize(name, resource)
+ super
+ @mirrors = resource.mirrors.dup
+ @tarball_path = HOMEBREW_CACHE.join("#{name}-#{resource.version}#{ext}")
+ @temporary_path = Pathname.new("#{tarball_path}.incomplete")
end
def cached_location