aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schmitt <david@schmitt.edv-bus.at>2008-02-29 16:51:51 +0100
committerDavid Schmitt <david@schmitt.edv-bus.at>2008-02-29 16:51:51 +0100
commit8891451fef0471fb2557db218d0d85f5082afd74 (patch)
tree18b85da54ef2d33d28d16034ee090d3dd9455cc9
parent39b980df2522d0e8d7fe91f3b6650dcb9490b485 (diff)
downloadpuppet-common-8891451fef0471fb2557db218d0d85f5082afd74.tar.gz
puppet-common-8891451fef0471fb2557db218d0d85f5082afd74.tar.bz2
add "prefix_with" function
-rw-r--r--plugins/puppet/parser/functions/prefix_with.rb9
1 files changed, 9 insertions, 0 deletions
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
+