diff options
author | mh <mh@immerda.ch> | 2009-04-30 13:40:43 +0000 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2010-09-02 18:10:33 -0400 |
commit | 61d767b56155650df65397ef326be28c2f35956f (patch) | |
tree | 592b6d7c78a8257a20a8af08655b17b124fae9fb | |
parent | 49b127b80a2248a1f5fb4bed1e0c0685583d6746 (diff) | |
download | puppet-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.rb | 6 |
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 + |