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 :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
|
||||
@specs ||= []
|
||||
end
|
||||
@ -666,16 +657,35 @@ class Formula
|
||||
spec
|
||||
end
|
||||
|
||||
def build
|
||||
@stable ||= create_spec(SoftwareSpec)
|
||||
@stable.build
|
||||
end
|
||||
|
||||
def url val, specs={}
|
||||
@stable ||= create_spec(SoftwareSpec)
|
||||
@stable.url(val, specs)
|
||||
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
|
||||
return @stable unless block_given?
|
||||
@stable ||= create_spec(SoftwareSpec)
|
||||
@ -706,16 +716,6 @@ class Formula
|
||||
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
|
||||
def resource name, &block
|
||||
specs.each do |spec|
|
||||
|
Loading…
x
Reference in New Issue
Block a user