diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-05-08 18:16:05 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-05-08 18:16:05 -0400 |
commit | 14d656dd415e75bc8768606944d579f182ede9ec (patch) | |
tree | d4faff54b5acadcc430675e992897f32b7409a72 /lib/puppet/parser/functions/is_float.rb | |
parent | e2297a1ea6b711ca930a21adc56aefe7c602826f (diff) | |
parent | 0804121719e4bde856723e19e8ff8bf6f9c2d55d (diff) |
Merge pull request #251 from hunner/fix_tests
Fix the stdlib functions that fail tests
Diffstat (limited to 'lib/puppet/parser/functions/is_float.rb')
-rw-r--r-- | lib/puppet/parser/functions/is_float.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/is_float.rb b/lib/puppet/parser/functions/is_float.rb index 911f3c2..a2da943 100644 --- a/lib/puppet/parser/functions/is_float.rb +++ b/lib/puppet/parser/functions/is_float.rb @@ -15,6 +15,9 @@ Returns true if the variable passed to this function is a float. value = arguments[0] + # Only allow Numeric or String types + return false unless value.is_a?(Numeric) or value.is_a?(String) + if value != value.to_f.to_s and !value.is_a? Float then return false else |