From 61d767b56155650df65397ef326be28c2f35956f Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 30 Apr 2009 13:40:43 +0000 Subject: added a strlength function to get the length of a string into puppet --- plugins/puppet/parser/functions/strlength.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 plugins/puppet/parser/functions/strlength.rb 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 + -- cgit v1.2.3