aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-04-30 13:40:43 +0000
committerMicah Anderson <micah@riseup.net>2010-09-02 18:10:33 -0400
commit61d767b56155650df65397ef326be28c2f35956f (patch)
tree592b6d7c78a8257a20a8af08655b17b124fae9fb
parent49b127b80a2248a1f5fb4bed1e0c0685583d6746 (diff)
downloadpuppet-common-61d767b56155650df65397ef326be28c2f35956f.tar.gz
puppet-common-61d767b56155650df65397ef326be28c2f35956f.tar.bz2
added a strlength function to get the length of a string into puppet
-rw-r--r--plugins/puppet/parser/functions/strlength.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/puppet/parser/functions/strlength.rb b/plugins/puppet/parser/functions/strlength.rb
new file mode 100644
index 0000000..3b99ed0
--- /dev/null
+++ b/plugins/puppet/parser/functions/strlength.rb
@@ -0,0 +1,6 @@
+module Puppet::Parser::Functions
+ newfunction(:strlength, :type => :rvalue) do |args|
+ argv[0].to_s.length
+ end
+end
+