]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Fixing ruby 1.8 support.
authorOliver Bertuch <o.bertuch@fz-juelich.de>
Fri, 5 Dec 2014 07:48:10 +0000 (08:48 +0100)
committerOliver Bertuch <o.bertuch@fz-juelich.de>
Fri, 5 Dec 2014 07:51:40 +0000 (08:51 +0100)
lib/puppet/parser/functions/validate_integer.rb
lib/puppet/parser/functions/validate_numeric.rb

index c12d6769b8285ec104a4e0035181a20a88d4c9e2..995f8dbf8bbc45dea71f210c35488e0885912560 100644 (file)
@@ -115,6 +115,9 @@ module Puppet::Parser::Functions
           raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}"
         end
       end
+    # for the sake of compatibility with ruby 1.8, we need extra handling of hashes
+    when Hash
+      raise Puppet::ParseError, "validate_integer(): Expected first argument to be an Integer or Array, got #{input.class}"
     # check the input. this will also fail any stuff other than pure, shiny integers
     else
       begin
index 27eec3068d1e6766888784ba8f691862c3babc77..d2e4d16a08faa9a0bdf79373631bb8d879dada83 100644 (file)
@@ -77,6 +77,9 @@ module Puppet::Parser::Functions
           raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}"
         end
       end
+    # for the sake of compatibility with ruby 1.8, we need extra handling of hashes
+    when Hash
+      raise Puppet::ParseError, "validate_integer(): Expected first argument to be a Numeric or Array, got #{input.class}"
     # check the input. this will also fail any stuff other than pure, shiny integers
     else
       begin