added a strlength function to get the length of a string into puppet
authormh <mh@immerda.ch>
Thu, 30 Apr 2009 13:40:43 +0000 (13:40 +0000)
committerMicah Anderson <micah@riseup.net>
Thu, 2 Sep 2010 22:10:33 +0000 (18:10 -0400)
plugins/puppet/parser/functions/strlength.rb [new file with mode: 0644]

diff --git a/plugins/puppet/parser/functions/strlength.rb b/plugins/puppet/parser/functions/strlength.rb
new file mode 100644 (file)
index 0000000..3b99ed0
--- /dev/null
@@ -0,0 +1,6 @@
+module Puppet::Parser::Functions
+    newfunction(:strlength, :type => :rvalue) do |args|
+       argv[0].to_s.length 
+    end
+end
+