From: mh Date: Thu, 30 Apr 2009 13:40:43 +0000 (+0000) Subject: added a strlength function to get the length of a string into puppet X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=61d767b56155650df65397ef326be28c2f35956f;p=puppet-common.git added a strlength function to get the length of a string into puppet --- 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 +