Merge instead of calling << in a loop

This commit is contained in:
Jack Nagel 2014-07-07 09:15:56 -05:00
parent aeccba8dbe
commit 9e7f5dc261
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,10 @@ class BuildEnvironment
@procs = Set.new
end
def merge(*args)
@settings.merge(*args)
end
def <<(o)
case o
when Proc then @procs << o
@ -41,7 +45,7 @@ module BuildEnvironmentDSL
if block_given?
@env << block
else
settings.each { |s| @env << s }
@env.merge(settings)
end
@env
end

View File

@ -104,7 +104,7 @@ class Options
end
def concat(o)
o.each { |opt| @options << opt }
@options.merge(o)
self
end