aboutsummaryrefslogtreecommitdiff
path: root/plugins/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/puppet')
-rw-r--r--plugins/puppet/parser/functions/basename.rb16
-rw-r--r--plugins/puppet/parser/functions/dirname.rb16
-rw-r--r--plugins/puppet/parser/functions/gsub.rb17
-rw-r--r--plugins/puppet/parser/functions/prefix_with.rb9
-rw-r--r--plugins/puppet/parser/functions/re_escape.rb7
-rw-r--r--plugins/puppet/parser/functions/sha1.rb9
-rw-r--r--plugins/puppet/parser/functions/slash_escape.rb7
-rw-r--r--plugins/puppet/parser/functions/split.rb17
-rw-r--r--plugins/puppet/parser/functions/strlength.rb6
-rw-r--r--plugins/puppet/parser/functions/substitute.rb20
10 files changed, 0 insertions, 124 deletions
diff --git a/plugins/puppet/parser/functions/basename.rb b/plugins/puppet/parser/functions/basename.rb
deleted file mode 100644
index 226d6e5..0000000
--- a/plugins/puppet/parser/functions/basename.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# basename(string) : string
-# 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.
-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 44b4a00..0000000
--- a/plugins/puppet/parser/functions/dirname.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# dirname(string) : string
-# 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.
-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 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/prefix_with.rb b/plugins/puppet/parser/functions/prefix_with.rb
deleted file mode 100644
index 6e64a4a..0000000
--- a/plugins/puppet/parser/functions/prefix_with.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# 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
-
diff --git a/plugins/puppet/parser/functions/re_escape.rb b/plugins/puppet/parser/functions/re_escape.rb
deleted file mode 100644
index 6e5904b..0000000
--- a/plugins/puppet/parser/functions/re_escape.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# apply 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/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/split.rb b/plugins/puppet/parser/functions/split.rb
deleted file mode 100644
index 5237c92..0000000
--- a/plugins/puppet/parser/functions/split.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# split($string, $delimiter) : $string
-# split($string[], $delimiter) : $string[][]
-#
-# Split the first argument(s) on every $delimiter. $delimiter 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(: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
diff --git a/plugins/puppet/parser/functions/strlength.rb b/plugins/puppet/parser/functions/strlength.rb
deleted file mode 100644
index 147b24a..0000000
--- a/plugins/puppet/parser/functions/strlength.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Puppet::Parser::Functions
- newfunction(:strlength, :type => :rvalue) do |args|
- args[0].to_s.length
- 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
-