Making sure that the function hash will also work on older Rubies.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
This commit is contained in:
Krzysztof Wilczynski 2011-04-30 03:44:59 +01:00
parent b3be789b0d
commit 8733a57ffb

View file

@ -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 ' +