From c65920d6b8d017c951838c72f4bbcb75d5b27234 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 2 Jun 2009 22:32:30 +0200 Subject: blob!=raw, should check wget better ;-) --- plugins/puppet/parser/functions/gsub.rb | 86 +++++++-------------------------- 1 file changed, 17 insertions(+), 69 deletions(-) (limited to 'plugins/puppet') diff --git a/plugins/puppet/parser/functions/gsub.rb b/plugins/puppet/parser/functions/gsub.rb index a85fd70..e2410ff 100644 --- a/plugins/puppet/parser/functions/gsub.rb +++ b/plugins/puppet/parser/functions/gsub.rb @@ -1,69 +1,17 @@ - - - - - - - - - -git.black.co.at Git - module-common/blob - plugins/puppet/parser/functions/gsub.rb - - - - - - - - - -
- -
- -
-create a common class to install openssl -
-
[module-common] / plugins / puppet / parser / functions / gsub.rb
-
-
1 module Puppet::Parser::Functions
-
2         # thin wrapper around the ruby gsub function
-
3         # gsub($string, $pattern, $replacement) will replace all occurrences of
-
4         # $pattern in $string with $replacement. $string can be either a singel
-
5         # value or an array. In the latter case, each element of the array will
-
6         # be processed in turn.
-
7         newfunction(:gsub, :type => :rvalue) do |args|
-
8                 if args[0].is_a?(Array)
-
9                         args[0].collect do |val|
-
10                                 val.gsub(/#{args[1]}/, args[2])
-
11                         end
-
12                 else
-
13                         args[0].gsub(/#{args[1]}/, args[2])
-
14                 end
-
15         end
-
16 end
- -
- - \ No newline at end of file +module Puppet::Parser::Functions + # thin wrapper around the ruby gsub function + # gsub($string, $pattern, $replacement) will replace all occurrences of + # $pattern in $string with $replacement. $string can be either a singel + # value or an array. In the latter case, each element of the array will + # be processed in turn. + newfunction(:gsub, :type => :rvalue) do |args| + if args[0].is_a?(Array) + args[0].collect do |val| + val.gsub(/#{args[1]}/, args[2]) + end + else + args[0].gsub(/#{args[1]}/, args[2]) + end + end +end + -- cgit v1.2.3