From ccb216c9c7408fd3019b9476d7e420f8d75693a8 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 20 Feb 2014 13:45:13 -0500 Subject: [PATCH] Delegate downloader to active_spec instead of storing it in an ivar --- Library/Homebrew/formula.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index a17f114f83..86444883a9 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -16,7 +16,7 @@ class Formula include Utils::Inreplace extend BuildEnvironmentDSL - attr_reader :name, :path, :homepage, :downloader, :build + attr_reader :name, :path, :homepage, :build attr_reader :stable, :bottle, :devel, :head, :active_spec # The current working directory during builds and tests. @@ -53,7 +53,6 @@ class Formula @active_spec = determine_active_spec validate_attributes :url, :name, :version - @downloader = active_spec.downloader @build = determine_build_options @pin = FormulaPin.new(self) @@ -120,6 +119,10 @@ class Formula active_spec.requirements end + def downloader + active_spec.downloader + end + # if the dir is there, but it's empty we consider it not installed def installed? (dir = installed_prefix).directory? && dir.children.length > 0