]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Making sure that the function hash will also work on older Rubies.
authorKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Sat, 30 Apr 2011 02:44:59 +0000 (03:44 +0100)
committerKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Sat, 30 Apr 2011 02:44:59 +0000 (03:44 +0100)
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
hash.rb

diff --git a/hash.rb b/hash.rb
index 7e63d43f91138007737284d0a2de7eb9e5af8b60..f0c01d4c9a070cdfb7000e6a0d342b723b642a17 100644 (file)
--- a/hash.rb
+++ b/hash.rb
@@ -19,6 +19,8 @@ module Puppet::Parser::Functions
     result = {}
 
     begin
+      # This is to make it compatible with older version of Ruby ...
+      array  = array.flatten
       result = Hash[*array]
     rescue Exception
       raise(Puppet::ParseError, 'hash(): Unable to compute ' +