diff options
Diffstat (limited to 'plugins/puppet/parser/functions')
-rw-r--r-- | plugins/puppet/parser/functions/gsub.rb | 17 | ||||
-rw-r--r-- | plugins/puppet/parser/functions/sha1.rb | 9 | ||||
-rw-r--r-- | plugins/puppet/parser/functions/slash_escape.rb | 7 | ||||
-rw-r--r-- | plugins/puppet/parser/functions/substitute.rb | 20 |
4 files changed, 0 insertions, 53 deletions
diff --git a/plugins/puppet/parser/functions/gsub.rb b/plugins/puppet/parser/functions/gsub.rb deleted file mode 100644 index e2410ff..0000000 --- a/plugins/puppet/parser/functions/gsub.rb +++ /dev/null @@ -1,17 +0,0 @@ -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 - diff --git a/plugins/puppet/parser/functions/sha1.rb b/plugins/puppet/parser/functions/sha1.rb deleted file mode 100644 index b5aa813..0000000 --- a/plugins/puppet/parser/functions/sha1.rb +++ /dev/null @@ -1,9 +0,0 @@ -# return the sha1 hash -require 'digest/sha1' - -module Puppet::Parser::Functions - newfunction(:sha1, :type => :rvalue) do |args| - Digest::SHA1.hexdigest(args[0]) - end -end - diff --git a/plugins/puppet/parser/functions/slash_escape.rb b/plugins/puppet/parser/functions/slash_escape.rb deleted file mode 100644 index 04d3b95..0000000 --- a/plugins/puppet/parser/functions/slash_escape.rb +++ /dev/null @@ -1,7 +0,0 @@ -# escape slashes in a String -module Puppet::Parser::Functions - newfunction(:slash_escape, :type => :rvalue) do |args| - args[0].gsub(/\//, '\\/') - end -end - diff --git a/plugins/puppet/parser/functions/substitute.rb b/plugins/puppet/parser/functions/substitute.rb deleted file mode 100644 index 4c97def..0000000 --- a/plugins/puppet/parser/functions/substitute.rb +++ /dev/null @@ -1,20 +0,0 @@ -# subsititute($string, $regex, $replacement) : $string -# subsititute($string[], $regex, $replacement) : $string[] -# -# Replace all ocurrences of $regex in $string by $replacement. -# $regex is interpreted as Ruby regular expression. -# -# For long-term portability it is recommended to refrain from using Ruby's -# extended RE features. -module Puppet::Parser::Functions - newfunction(:substitute, :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 - |