From e90839b24871f9cfd2166a116e45de5f27fe9e50 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 8 Oct 2011 20:07:53 +0200 Subject: remove a couple of functions that can now be found in the puppetlabs stdlib --- lib/puppet/parser/functions/array_del.rb | 11 ----------- lib/puppet/parser/functions/hash_merge.rb | 10 ---------- lib/puppet/parser/functions/join.rb | 10 ---------- lib/puppet/parser/functions/strlength.rb | 6 ------ lib/puppet/parser/functions/uniq_flatten.rb | 10 ---------- 5 files changed, 47 deletions(-) delete mode 100644 lib/puppet/parser/functions/array_del.rb delete mode 100644 lib/puppet/parser/functions/hash_merge.rb delete mode 100644 lib/puppet/parser/functions/join.rb delete mode 100644 lib/puppet/parser/functions/strlength.rb delete mode 100644 lib/puppet/parser/functions/uniq_flatten.rb (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/functions/array_del.rb b/lib/puppet/parser/functions/array_del.rb deleted file mode 100644 index e604916..0000000 --- a/lib/puppet/parser/functions/array_del.rb +++ /dev/null @@ -1,11 +0,0 @@ -Puppet::Parser::Functions::newfunction( - :array_del, - :type => :rvalue, - :doc => "Deletes items from an array - - Example: array_del(['a','b'],'b') -> ['a']" -) do |args| - raise Puppet::ParseError, 'array_del() needs two arguments' if args.length != 2 - (res=args[0].dup).to_a.delete(args[1]) - res -end diff --git a/lib/puppet/parser/functions/hash_merge.rb b/lib/puppet/parser/functions/hash_merge.rb deleted file mode 100644 index 831c754..0000000 --- a/lib/puppet/parser/functions/hash_merge.rb +++ /dev/null @@ -1,10 +0,0 @@ -Puppet::Parser::Functions::newfunction( - :hash_merge, - :type => :rvalue, - :doc => "Merges two hashes - - Example: hash_merge({'a' => 1 ,'b' => 2},{'b' => 3, 'c' => 4}) -> {'a' => 1 ,'b' => 3, 'c' => 4}" -) do |args| - raise Puppet::ParseError, 'hash_merge() needs two arguments' if args.length != 2 - args[0].merge(args[1]) -end diff --git a/lib/puppet/parser/functions/join.rb b/lib/puppet/parser/functions/join.rb deleted file mode 100644 index 95b664c..0000000 --- a/lib/puppet/parser/functions/join.rb +++ /dev/null @@ -1,10 +0,0 @@ -Puppet::Parser::Functions::newfunction( - :join, - :type => :rvalue, - :doc => "Joins the values of the array in arg1 with the string in arg2 - - Example: join(['a','b'],',') -> 'a,b'" -) do |args| - raise Puppet::ParseError, 'join() needs two arguments' if args.length != 2 - args[0].to_a.join(args[1]) -end diff --git a/lib/puppet/parser/functions/strlength.rb b/lib/puppet/parser/functions/strlength.rb deleted file mode 100644 index 147b24a..0000000 --- a/lib/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/lib/puppet/parser/functions/uniq_flatten.rb b/lib/puppet/parser/functions/uniq_flatten.rb deleted file mode 100644 index 4841c4d..0000000 --- a/lib/puppet/parser/functions/uniq_flatten.rb +++ /dev/null @@ -1,10 +0,0 @@ -Puppet::Parser::Functions::newfunction( - :uniq_flatten, - :type => :rvalue, - :doc => "Flattens an array and make it uniq - - Example: uniq_flatten([['a','b'],'a']) -> ['a','b']" -) do |args| - raise Puppet::ParseError, 'uniq_flatten() needs one arguments' if args.length != 1 - args[0].to_a.flatten.collect(&:to_s).uniq -end -- cgit v1.2.3