Group DSL methods that delegate to the stable spec
This commit is contained in:
parent
134210d9ed
commit
28c8395f3d
@ -647,15 +647,6 @@ class Formula
|
|||||||
attr_rw :homepage, :keg_only_reason, :cc_failures
|
attr_rw :homepage, :keg_only_reason, :cc_failures
|
||||||
attr_rw :plist_startup, :plist_manual
|
attr_rw :plist_startup, :plist_manual
|
||||||
|
|
||||||
Checksum::TYPES.each do |cksum|
|
|
||||||
class_eval <<-EOS, __FILE__, __LINE__ + 1
|
|
||||||
def #{cksum}(val)
|
|
||||||
@stable ||= create_spec(SoftwareSpec)
|
|
||||||
@stable.#{cksum}(val)
|
|
||||||
end
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
def specs
|
def specs
|
||||||
@specs ||= []
|
@specs ||= []
|
||||||
end
|
end
|
||||||
@ -666,16 +657,35 @@ class Formula
|
|||||||
spec
|
spec
|
||||||
end
|
end
|
||||||
|
|
||||||
def build
|
|
||||||
@stable ||= create_spec(SoftwareSpec)
|
|
||||||
@stable.build
|
|
||||||
end
|
|
||||||
|
|
||||||
def url val, specs={}
|
def url val, specs={}
|
||||||
@stable ||= create_spec(SoftwareSpec)
|
@stable ||= create_spec(SoftwareSpec)
|
||||||
@stable.url(val, specs)
|
@stable.url(val, specs)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def version val=nil
|
||||||
|
@stable ||= create_spec(SoftwareSpec)
|
||||||
|
@stable.version(val)
|
||||||
|
end
|
||||||
|
|
||||||
|
def mirror val
|
||||||
|
@stable ||= create_spec(SoftwareSpec)
|
||||||
|
@stable.mirror(val)
|
||||||
|
end
|
||||||
|
|
||||||
|
Checksum::TYPES.each do |cksum|
|
||||||
|
class_eval <<-EOS, __FILE__, __LINE__ + 1
|
||||||
|
def #{cksum}(val)
|
||||||
|
@stable ||= create_spec(SoftwareSpec)
|
||||||
|
@stable.#{cksum}(val)
|
||||||
|
end
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
|
def build
|
||||||
|
@stable ||= create_spec(SoftwareSpec)
|
||||||
|
@stable.build
|
||||||
|
end
|
||||||
|
|
||||||
def stable &block
|
def stable &block
|
||||||
return @stable unless block_given?
|
return @stable unless block_given?
|
||||||
@stable ||= create_spec(SoftwareSpec)
|
@stable ||= create_spec(SoftwareSpec)
|
||||||
@ -706,16 +716,6 @@ class Formula
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def version val=nil
|
|
||||||
@stable ||= create_spec(SoftwareSpec)
|
|
||||||
@stable.version(val)
|
|
||||||
end
|
|
||||||
|
|
||||||
def mirror val
|
|
||||||
@stable ||= create_spec(SoftwareSpec)
|
|
||||||
@stable.mirror(val)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Define a named resource using a SoftwareSpec style block
|
# Define a named resource using a SoftwareSpec style block
|
||||||
def resource name, &block
|
def resource name, &block
|
||||||
specs.each do |spec|
|
specs.each do |spec|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user