Fixing ruby 1.8 support.
This commit is contained in:
parent
260c1f4b92
commit
3053427829
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue