summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>2011-04-30 03:44:59 +0100
committerKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>2011-04-30 03:44:59 +0100
commit8733a57ffb6e831274e73eb03fe1662ffa6e04d7 (patch)
tree12b9506a327c61aa9a8242341c352bb8b02df2ed
parentb3be789b0da179e1011323e95468d3a1f2fd5083 (diff)
Making sure that the function hash will also work on older Rubies.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
-rw-r--r--hash.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.rb b/hash.rb
index 7e63d43..f0c01d4 100644
--- 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 ' +