From 3ff12051c8efabcdfb43b99810ff1c2ea22750a3 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 23 Nov 2009 11:54:04 -0500 Subject: move plugin directory to fit new 0.25.x style and update file paths accordingly --- plugins/puppet/parser/functions/basename.rb | 22 ---------------------- plugins/puppet/parser/functions/dirname.rb | 22 ---------------------- plugins/puppet/parser/functions/gsub.rb | 21 --------------------- plugins/puppet/parser/functions/prefix_with.rb | 19 ------------------- plugins/puppet/parser/functions/re_escape.rb | 7 ------- plugins/puppet/parser/functions/split.rb | 23 ----------------------- 6 files changed, 114 deletions(-) delete mode 100644 plugins/puppet/parser/functions/basename.rb delete mode 100644 plugins/puppet/parser/functions/dirname.rb delete mode 100644 plugins/puppet/parser/functions/gsub.rb delete mode 100644 plugins/puppet/parser/functions/prefix_with.rb delete mode 100644 plugins/puppet/parser/functions/re_escape.rb delete mode 100644 plugins/puppet/parser/functions/split.rb (limited to 'plugins/puppet') diff --git a/plugins/puppet/parser/functions/basename.rb b/plugins/puppet/parser/functions/basename.rb deleted file mode 100644 index dc72537..0000000 --- a/plugins/puppet/parser/functions/basename.rb +++ /dev/null @@ -1,22 +0,0 @@ -# This function has two modes of operation: -# -# basename(string) : string -# -# Returns the last component of the filename given as argument, which must be -# formed using forward slashes ("/") regardless of the separator used on the -# local file system. -# -# basename(string[]) : string[] -# -# Returns an array of strings with the basename of each item from the argument. -# -module Puppet::Parser::Functions - newfunction(:basename, :type => :rvalue) do |args| - if args[0].is_a?(Array) - args.collect do |a| File.basename(a) end - else - File.basename(args[0]) - end - end -end - diff --git a/plugins/puppet/parser/functions/dirname.rb b/plugins/puppet/parser/functions/dirname.rb deleted file mode 100644 index ea0d50b..0000000 --- a/plugins/puppet/parser/functions/dirname.rb +++ /dev/null @@ -1,22 +0,0 @@ -# This function has two modes of operation: -# -# dirname(string) : string -# -# Returns all components of the filename given as argument except the last -# one. The filename must be formed using forward slashes (``/..) regardless of -# the separator used on the local file system. -# -# dirname(string[]) : string[] -# -# Returns an array of strings with the basename of each item from the argument. -# -module Puppet::Parser::Functions - newfunction(:dirname, :type => :rvalue) do |args| - if args[0].is_a?(Array) - args.collect do |a| File.dirname(a) end - else - File.dirname(args[0]) - end - end -end - diff --git a/plugins/puppet/parser/functions/gsub.rb b/plugins/puppet/parser/functions/gsub.rb deleted file mode 100644 index 27e6192..0000000 --- a/plugins/puppet/parser/functions/gsub.rb +++ /dev/null @@ -1,21 +0,0 @@ -# -# A 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 single value or an array. In the latter case, each -# element of the array will be processed in turn. -# -module Puppet::Parser::Functions - 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/prefix_with.rb b/plugins/puppet/parser/functions/prefix_with.rb deleted file mode 100644 index 5a12986..0000000 --- a/plugins/puppet/parser/functions/prefix_with.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Prefixes arguments 2..n with first argument. -# -# prefix_with(string prefix, string[] arguments) : string[] -# -# Example: -# -# prefix_with("php-", [ "blah", "foo" ]) -# -# will result in this array: -# -# [ "php-blah", "php-foo" ] -# -module Puppet::Parser::Functions - newfunction(:prefix_with, :type => :rvalue) do |args| - prefix = args.shift - args.collect {|v| "%s%s" % [prefix, v] } - end -end - diff --git a/plugins/puppet/parser/functions/re_escape.rb b/plugins/puppet/parser/functions/re_escape.rb deleted file mode 100644 index 7bee90a..0000000 --- a/plugins/puppet/parser/functions/re_escape.rb +++ /dev/null @@ -1,7 +0,0 @@ -# apply ruby regexp escaping to a string -module Puppet::Parser::Functions - newfunction(:re_escape, :type => :rvalue) do |args| - Regexp.escape(args[0]) - end -end - diff --git a/plugins/puppet/parser/functions/split.rb b/plugins/puppet/parser/functions/split.rb deleted file mode 100644 index bffecc1..0000000 --- a/plugins/puppet/parser/functions/split.rb +++ /dev/null @@ -1,23 +0,0 @@ -# This function has two modes of operation: -# -# split($string, $delimiter) : $string -# -# Split the first argument on every $delimiter. $delimiter is interpreted as -# Ruby regular expression. -# -# split($string[], $delimiter) : $string[][] -# -# Returns an array of split results with the result of applying split to each -# item from the first argument. -# -# For long-term portability it is recommended to refrain from using Ruby's -# extended RE features. -module Puppet::Parser::Functions - newfunction(:split, :type => :rvalue) do |args| - if args[0].is_a?(Array) - args.collect do |a| a.split(/#{args[1]}/) end - else - args[0].split(/#{args[1]}/) - end - end -end -- cgit v1.2.3