Skip to content

Commit 3053427

Browse files
committed
Fixing ruby 1.8 support.
1 parent 260c1f4 commit 3053427

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

lib/puppet/parser/functions/validate_integer.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ module Puppet::Parser::Functions
115115
raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}"
116116
end
117117
end
118+
# for the sake of compatibility with ruby 1.8, we need extra handling of hashes
119+
when Hash
120+
raise Puppet::ParseError, "validate_integer(): Expected first argument to be an Integer or Array, got #{input.class}"
118121
# check the input. this will also fail any stuff other than pure, shiny integers
119122
else
120123
begin

lib/puppet/parser/functions/validate_numeric.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ module Puppet::Parser::Functions
7777
raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}"
7878
end
7979
end
80+
# for the sake of compatibility with ruby 1.8, we need extra handling of hashes
81+
when Hash
82+
raise Puppet::ParseError, "validate_integer(): Expected first argument to be a Numeric or Array, got #{input.class}"
8083
# check the input. this will also fail any stuff other than pure, shiny integers
8184
else
8285
begin

0 commit comments

Comments
 (0)