]> gitweb.fluxo.info Git - puppet-common.git/commitdiff
add "prefix_with" function
authorDavid Schmitt <david@schmitt.edv-bus.at>
Fri, 29 Feb 2008 15:51:51 +0000 (16:51 +0100)
committerDavid Schmitt <david@schmitt.edv-bus.at>
Fri, 29 Feb 2008 15:51:51 +0000 (16:51 +0100)
plugins/puppet/parser/functions/prefix_with.rb [new file with mode: 0644]

diff --git a/plugins/puppet/parser/functions/prefix_with.rb b/plugins/puppet/parser/functions/prefix_with.rb
new file mode 100644 (file)
index 0000000..6e64a4a
--- /dev/null
@@ -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
+