Delegate homepage to the class instead of storing it on the instance

This commit is contained in:
Jack Nagel 2014-08-08 10:53:00 -05:00
parent 392407c5f1
commit dfe1de7acd

View File

@ -16,7 +16,7 @@ class Formula
include Utils::Inreplace include Utils::Inreplace
extend Enumerable extend Enumerable
attr_reader :name, :path, :homepage attr_reader :name, :path
attr_reader :stable, :devel, :head, :active_spec attr_reader :stable, :devel, :head, :active_spec
attr_reader :pkg_version, :revision attr_reader :pkg_version, :revision
@ -29,7 +29,6 @@ class Formula
def initialize(name, path, spec) def initialize(name, path, spec)
@name = name @name = name
@path = path @path = path
@homepage = self.class.homepage
@revision = self.class.revision || 0 @revision = self.class.revision || 0
set_spec :stable set_spec :stable
@ -68,6 +67,10 @@ class Formula
Bottle.new(self, active_spec.bottle_specification) if active_spec.bottled? Bottle.new(self, active_spec.bottle_specification) if active_spec.bottled?
end end
def homepage
self.class.homepage
end
def url; active_spec.url; end def url; active_spec.url; end
def version; active_spec.version; end def version; active_spec.version; end