From: David Schmitt Date: Fri, 29 Feb 2008 15:51:51 +0000 (+0100) Subject: add "prefix_with" function X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=8891451fef0471fb2557db218d0d85f5082afd74;p=puppet-common.git add "prefix_with" function --- diff --git a/plugins/puppet/parser/functions/prefix_with.rb b/plugins/puppet/parser/functions/prefix_with.rb new file mode 100644 index 0000000..6e64a4a --- /dev/null +++ b/plugins/puppet/parser/functions/prefix_with.rb @@ -0,0 +1,9 @@ +# prefix arguments 2..n with first argument + +module Puppet::Parser::Functions + newfunction(:prefix_with, :type => :rvalue) do |args| + prefix = args.shift + args.collect {|v| "%s%s" % [prefix, v] } + end +end +