summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErik Dalén <dalen@spotify.com>2014-11-12 16:02:05 +0100
committerErik Dalén <dalen@spotify.com>2014-11-12 16:02:05 +0100
commitce995e15d5c266fd6d7fa781284771a5a5d5b00e (patch)
treea711edba883b2df23a0b346f133ebad69fa86bff /lib
parente61f402283774883d7b7c7d0f04dec7c457c968c (diff)
Make the range function work with integers
This is needed for the future parser which actually treats numbers as numbers and strings as strings. With this patch you can use range(1,5) instead of having to quote them like range('1','5').
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/range.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/range.rb b/lib/puppet/parser/functions/range.rb
index 06d75d4..49fba21 100644
--- a/lib/puppet/parser/functions/range.rb
+++ b/lib/puppet/parser/functions/range.rb
@@ -66,7 +66,7 @@ Will return: [0,2,4,6,8]
end
# Check whether we have integer value if so then make it so ...
- if start.match(/^\d+$/)
+ if start.to_s.match(/^\d+$/)
start = start.to_i
stop = stop.to_i
else