From 8891451fef0471fb2557db218d0d85f5082afd74 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Fri, 29 Feb 2008 16:51:51 +0100 Subject: add "prefix_with" function --- plugins/puppet/parser/functions/prefix_with.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/puppet/parser/functions/prefix_with.rb (limited to 'plugins/puppet') 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 + -- cgit v1.2.3