From b54682f7091724fee2537b25a2dcc4d084d6a773 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 1 Sep 2018 15:59:25 +0200 Subject: [PATCH] Avoid network call in `#initialize`. --- Library/Homebrew/download_strategy.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 6319fdf4f9..619b490a00 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -188,11 +188,8 @@ class VCSDownloadStrategy < AbstractDownloadStrategy end class AbstractFileDownloadStrategy < AbstractDownloadStrategy - attr_reader :temporary_path - - def initialize(url, name, version, **meta) - super - @temporary_path = Pathname.new("#{cached_location}.incomplete") + def temporary_path + @temporary_path ||= Pathname.new("#{cached_location}.incomplete") end def symlink_location