]> gitweb.fluxo.info Git - puppet-stdlib.git/commit
(#8717) Make merge() function work with Ruby 1.8.5
authorJeff McCune <jeff@puppetlabs.com>
Mon, 1 Aug 2011 18:30:28 +0000 (11:30 -0700)
committerJeff McCune <jeff@puppetlabs.com>
Mon, 1 Aug 2011 18:45:08 +0000 (11:45 -0700)
commit4725c97102e1013e212b76b349a97f9dda51fabc
tree3d21a63153af0fd6845801344ad71adf7b35b310
parent2e3d49d17448ae799c88470f2bb5b09d463bbe22
(#8717) Make merge() function work with Ruby 1.8.5

The previous behavior of the merge() function used Array#inject with two
arguments.  Ruby 1.8.5 only supports inject being used with one
argument.

This change initializes and empty Hash object and merges each argument
into the accumulator.  The last argument still "wins" in the merge.

rspec tests (cd spec; rspec **/*_spec.rb) verified as passing with this
change.

Reviewed-by: Dan Bode
lib/puppet/parser/functions/merge.rb