head DSL can accept a block
This commit is contained in:
parent
f2ebc0e325
commit
320356236d
@ -695,10 +695,16 @@ class Formula
|
|||||||
@devel.instance_eval(&block)
|
@devel.instance_eval(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def head val=nil, specs={}
|
def head val=nil, specs={}, &block
|
||||||
return @head if val.nil?
|
if block_given?
|
||||||
@head ||= HeadSoftwareSpec.new
|
@head ||= HeadSoftwareSpec.new
|
||||||
@head.url(val, specs)
|
@head.instance_eval(&block)
|
||||||
|
elsif val
|
||||||
|
@head ||= HeadSoftwareSpec.new
|
||||||
|
@head.url(val, specs)
|
||||||
|
else
|
||||||
|
@head
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def version val=nil
|
def version val=nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user