Remove now unnecessary branching from bottle DSL methods
This commit is contained in:
parent
f1601f6d8a
commit
7552669719
@ -164,13 +164,9 @@ class BottleSpecification
|
|||||||
# a Hash, which indicates the platform the checksum applies on.
|
# a Hash, which indicates the platform the checksum applies on.
|
||||||
Checksum::TYPES.each do |cksum|
|
Checksum::TYPES.each do |cksum|
|
||||||
class_eval <<-EOS, __FILE__, __LINE__ + 1
|
class_eval <<-EOS, __FILE__, __LINE__ + 1
|
||||||
def #{cksum}(val=nil)
|
def #{cksum}(val)
|
||||||
return collector if val.nil?
|
digest, tag = val.shift
|
||||||
case val
|
collector.add(Checksum.new(:#{cksum}, digest), tag)
|
||||||
when Hash
|
|
||||||
key, value = val.shift
|
|
||||||
collector.add(Checksum.new(:#{cksum}, key), value)
|
|
||||||
end
|
|
||||||
|
|
||||||
cksum, current_tag = collector.fetch_bottle_for(bottle_tag)
|
cksum, current_tag = collector.fetch_bottle_for(bottle_tag)
|
||||||
@checksum = cksum if cksum
|
@checksum = cksum if cksum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user