Delegate downloader to active_spec instead of storing it in an ivar
This commit is contained in:
parent
3aa06a701d
commit
ccb216c9c7
@ -16,7 +16,7 @@ class Formula
|
|||||||
include Utils::Inreplace
|
include Utils::Inreplace
|
||||||
extend BuildEnvironmentDSL
|
extend BuildEnvironmentDSL
|
||||||
|
|
||||||
attr_reader :name, :path, :homepage, :downloader, :build
|
attr_reader :name, :path, :homepage, :build
|
||||||
attr_reader :stable, :bottle, :devel, :head, :active_spec
|
attr_reader :stable, :bottle, :devel, :head, :active_spec
|
||||||
|
|
||||||
# The current working directory during builds and tests.
|
# The current working directory during builds and tests.
|
||||||
@ -53,7 +53,6 @@ class Formula
|
|||||||
|
|
||||||
@active_spec = determine_active_spec
|
@active_spec = determine_active_spec
|
||||||
validate_attributes :url, :name, :version
|
validate_attributes :url, :name, :version
|
||||||
@downloader = active_spec.downloader
|
|
||||||
@build = determine_build_options
|
@build = determine_build_options
|
||||||
|
|
||||||
@pin = FormulaPin.new(self)
|
@pin = FormulaPin.new(self)
|
||||||
@ -120,6 +119,10 @@ class Formula
|
|||||||
active_spec.requirements
|
active_spec.requirements
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def downloader
|
||||||
|
active_spec.downloader
|
||||||
|
end
|
||||||
|
|
||||||
# if the dir is there, but it's empty we consider it not installed
|
# if the dir is there, but it's empty we consider it not installed
|
||||||
def installed?
|
def installed?
|
||||||
(dir = installed_prefix).directory? && dir.children.length > 0
|
(dir = installed_prefix).directory? && dir.children.length > 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user