summaryrefslogtreecommitdiff
path: root/lib/puppet
diff options
context:
space:
mode:
authorSteve Huff <shuff@vecna.org>2013-03-29 10:04:05 -0400
committerSteve Huff <shuff@vecna.org>2013-03-29 12:53:56 -0400
commite6916f83fd35989db4b86dfb10716c9198994389 (patch)
treed0377c4e8abaf579ccfba824a762e3cbcf3f96bc /lib/puppet
parent4078a6ff44c3ea8c2a071eec3bd7b02dabc770d7 (diff)
Enable num2bool to accept numeric input
Also ignore rspec fixtures directory
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/parser/functions/num2bool.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/num2bool.rb b/lib/puppet/parser/functions/num2bool.rb
index 874db22..638f693 100644
--- a/lib/puppet/parser/functions/num2bool.rb
+++ b/lib/puppet/parser/functions/num2bool.rb
@@ -14,7 +14,8 @@ higher then 0 become true.
raise(Puppet::ParseError, "num2bool(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
- number = arguments[0]
+ # Since we're matching against a regex, coerce to String
+ number = arguments[0].to_s
# Only numbers allowed ...
unless number.match(/^\-?\d+$/)