Merge instead of calling << in a loop
This commit is contained in:
parent
aeccba8dbe
commit
9e7f5dc261
@ -6,6 +6,10 @@ class BuildEnvironment
|
|||||||
@procs = Set.new
|
@procs = Set.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def merge(*args)
|
||||||
|
@settings.merge(*args)
|
||||||
|
end
|
||||||
|
|
||||||
def <<(o)
|
def <<(o)
|
||||||
case o
|
case o
|
||||||
when Proc then @procs << o
|
when Proc then @procs << o
|
||||||
@ -41,7 +45,7 @@ module BuildEnvironmentDSL
|
|||||||
if block_given?
|
if block_given?
|
||||||
@env << block
|
@env << block
|
||||||
else
|
else
|
||||||
settings.each { |s| @env << s }
|
@env.merge(settings)
|
||||||
end
|
end
|
||||||
@env
|
@env
|
||||||
end
|
end
|
||||||
|
@ -104,7 +104,7 @@ class Options
|
|||||||
end
|
end
|
||||||
|
|
||||||
def concat(o)
|
def concat(o)
|
||||||
o.each { |opt| @options << opt }
|
@options.merge(o)
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user