summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Barber <ken@bob.sh>2011-04-30 16:00:49 +0200
committerKen Barber <ken@bob.sh>2011-04-30 16:00:49 +0200
commitaafce9c99b779855e1e10e5a337848fa9f676a01 (patch)
treed012e1ca5ea41a41cd8782c7c106f91b51bc1be4
parent09abea2d47b09b9e8933a1c27c7a454c77760e83 (diff)
Moved more functions into lib/puppet/parser/functions/
-rw-r--r--lib/puppet/parser/functions/capitalize.rb (renamed from capitalize.rb)0
-rw-r--r--lib/puppet/parser/functions/chomp.rb (renamed from chomp.rb)0
-rw-r--r--lib/puppet/parser/functions/chop.rb (renamed from chop.rb)0
-rw-r--r--lib/puppet/parser/functions/date.rb (renamed from date.rb)0
-rw-r--r--lib/puppet/parser/functions/delete.rb (renamed from delete.rb)0
-rw-r--r--lib/puppet/parser/functions/downcase.rb (renamed from downcase.rb)0
-rw-r--r--lib/puppet/parser/functions/flatten.rb (renamed from flatten.rb)0
-rw-r--r--lib/puppet/parser/functions/grep.rb (renamed from grep.rb)0
-rw-r--r--lib/puppet/parser/functions/hash.rb (renamed from hash.rb)0
-rw-r--r--lib/puppet/parser/functions/is_float.rb (renamed from is_float.rb)0
-rw-r--r--lib/puppet/parser/functions/is_integer.rb (renamed from is_integer.rb)0
-rw-r--r--lib/puppet/parser/functions/is_numeric.rb (renamed from is_numeric.rb)0
-rw-r--r--lib/puppet/parser/functions/is_valid_domain_name.rb (renamed from is_valid_domain_name.rb)0
-rw-r--r--lib/puppet/parser/functions/is_valid_ip_address.rb (renamed from is_valid_ip_address.rb)0
-rw-r--r--lib/puppet/parser/functions/is_valid_mac_address.rb (renamed from is_valid_mac_address.rb)0
-rw-r--r--lib/puppet/parser/functions/is_valid_netmask.rb (renamed from is_valid_netmask.rb)0
-rw-r--r--lib/puppet/parser/functions/load_json.rb (renamed from load_json.rb)0
-rw-r--r--lib/puppet/parser/functions/load_yaml.rb (renamed from load_yaml.rb)0
-rw-r--r--lib/puppet/parser/functions/lstrip.rb (renamed from lstrip.rb)0
-rw-r--r--lib/puppet/parser/functions/member.rb14
-rw-r--r--lib/puppet/parser/functions/rand.rb (renamed from rand.rb)0
-rw-r--r--lib/puppet/parser/functions/rstrip.rb (renamed from rstrip.rb)0
-rw-r--r--lib/puppet/parser/functions/sort.rb (renamed from sort.rb)0
-rw-r--r--lib/puppet/parser/functions/squeeze.rb (renamed from squeeze.rb)0
-rw-r--r--lib/puppet/parser/functions/str2bool.rb (renamed from str2bool.rb)0
-rw-r--r--lib/puppet/parser/functions/strip.rb (renamed from strip.rb)0
-rw-r--r--lib/puppet/parser/functions/swapcase.rb (renamed from swapcase.rb)0
-rw-r--r--lib/puppet/parser/functions/upcase.rb (renamed from upcase.rb)0
-rw-r--r--lib/puppet/parser/functions/zip.rb (renamed from zip.rb)0
-rw-r--r--member.rb33
30 files changed, 7 insertions, 40 deletions
diff --git a/capitalize.rb b/lib/puppet/parser/functions/capitalize.rb
index f902cb3..f902cb3 100644
--- a/capitalize.rb
+++ b/lib/puppet/parser/functions/capitalize.rb
diff --git a/chomp.rb b/lib/puppet/parser/functions/chomp.rb
index e1d788a..e1d788a 100644
--- a/chomp.rb
+++ b/lib/puppet/parser/functions/chomp.rb
diff --git a/chop.rb b/lib/puppet/parser/functions/chop.rb
index 0f9af86..0f9af86 100644
--- a/chop.rb
+++ b/lib/puppet/parser/functions/chop.rb
diff --git a/date.rb b/lib/puppet/parser/functions/date.rb
index ea11265..ea11265 100644
--- a/date.rb
+++ b/lib/puppet/parser/functions/date.rb
diff --git a/delete.rb b/lib/puppet/parser/functions/delete.rb
index b8376d1..b8376d1 100644
--- a/delete.rb
+++ b/lib/puppet/parser/functions/delete.rb
diff --git a/downcase.rb b/lib/puppet/parser/functions/downcase.rb
index 71f8480..71f8480 100644
--- a/downcase.rb
+++ b/lib/puppet/parser/functions/downcase.rb
diff --git a/flatten.rb b/lib/puppet/parser/functions/flatten.rb
index 6036f72..6036f72 100644
--- a/flatten.rb
+++ b/lib/puppet/parser/functions/flatten.rb
diff --git a/grep.rb b/lib/puppet/parser/functions/grep.rb
index 1663fe7..1663fe7 100644
--- a/grep.rb
+++ b/lib/puppet/parser/functions/grep.rb
diff --git a/hash.rb b/lib/puppet/parser/functions/hash.rb
index f0c01d4..f0c01d4 100644
--- a/hash.rb
+++ b/lib/puppet/parser/functions/hash.rb
diff --git a/is_float.rb b/lib/puppet/parser/functions/is_float.rb
index 2a5a923..2a5a923 100644
--- a/is_float.rb
+++ b/lib/puppet/parser/functions/is_float.rb
diff --git a/is_integer.rb b/lib/puppet/parser/functions/is_integer.rb
index 44337f0..44337f0 100644
--- a/is_integer.rb
+++ b/lib/puppet/parser/functions/is_integer.rb
diff --git a/is_numeric.rb b/lib/puppet/parser/functions/is_numeric.rb
index 7a64091..7a64091 100644
--- a/is_numeric.rb
+++ b/lib/puppet/parser/functions/is_numeric.rb
diff --git a/is_valid_domain_name.rb b/lib/puppet/parser/functions/is_valid_domain_name.rb
index 05d64be..05d64be 100644
--- a/is_valid_domain_name.rb
+++ b/lib/puppet/parser/functions/is_valid_domain_name.rb
diff --git a/is_valid_ip_address.rb b/lib/puppet/parser/functions/is_valid_ip_address.rb
index e6b68a8..e6b68a8 100644
--- a/is_valid_ip_address.rb
+++ b/lib/puppet/parser/functions/is_valid_ip_address.rb
diff --git a/is_valid_mac_address.rb b/lib/puppet/parser/functions/is_valid_mac_address.rb
index 5e354c9..5e354c9 100644
--- a/is_valid_mac_address.rb
+++ b/lib/puppet/parser/functions/is_valid_mac_address.rb
diff --git a/is_valid_netmask.rb b/lib/puppet/parser/functions/is_valid_netmask.rb
index 2aeb374..2aeb374 100644
--- a/is_valid_netmask.rb
+++ b/lib/puppet/parser/functions/is_valid_netmask.rb
diff --git a/load_json.rb b/lib/puppet/parser/functions/load_json.rb
index 9ec8c78..9ec8c78 100644
--- a/load_json.rb
+++ b/lib/puppet/parser/functions/load_json.rb
diff --git a/load_yaml.rb b/lib/puppet/parser/functions/load_yaml.rb
index 684a721..684a721 100644
--- a/load_yaml.rb
+++ b/lib/puppet/parser/functions/load_yaml.rb
diff --git a/lstrip.rb b/lib/puppet/parser/functions/lstrip.rb
index a7b2656..a7b2656 100644
--- a/lstrip.rb
+++ b/lib/puppet/parser/functions/lstrip.rb
diff --git a/lib/puppet/parser/functions/member.rb b/lib/puppet/parser/functions/member.rb
index a491a76..bb43a37 100644
--- a/lib/puppet/parser/functions/member.rb
+++ b/lib/puppet/parser/functions/member.rb
@@ -1,28 +1,28 @@
#
-# include.rb
+# member.rb
#
# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
# TODO(Krzysztof Wilczynski): Support for strings and hashes too ...
module Puppet::Parser::Functions
- newfunction(:includes, :type => :rvalue, :doc => <<-EOS
+ newfunction(:member, :type => :rvalue, :doc => <<-EOS
EOS
) do |arguments|
- raise(Puppet::ParseError, "includes(): Wrong number of arguments " +
+ raise(Puppet::ParseError, "member(): Wrong number of arguments " +
"given (#{arguments.size} for 2)") if arguments.size < 2
array = arguments[0]
- if not array.is_a?(Array)
- raise(Puppet::ParseError, 'includes(): Requires an array to work with')
+ unless array.is_a?(Array)
+ raise(Puppet::ParseError, 'member(): Requires array to work with')
end
item = arguments[1]
- raise(Puppet::ParseError, 'includes(): You must provide item ' +
- 'to search for within given array') if item.empty?
+ raise(Puppet::ParseError, 'member(): You must provide item ' +
+ 'to search for within array given') if item.empty?
result = array.include?(item)
diff --git a/rand.rb b/lib/puppet/parser/functions/rand.rb
index 2cb9acb..2cb9acb 100644
--- a/rand.rb
+++ b/lib/puppet/parser/functions/rand.rb
diff --git a/rstrip.rb b/lib/puppet/parser/functions/rstrip.rb
index 56849d3..56849d3 100644
--- a/rstrip.rb
+++ b/lib/puppet/parser/functions/rstrip.rb
diff --git a/sort.rb b/lib/puppet/parser/functions/sort.rb
index 85e5ba0..85e5ba0 100644
--- a/sort.rb
+++ b/lib/puppet/parser/functions/sort.rb
diff --git a/squeeze.rb b/lib/puppet/parser/functions/squeeze.rb
index a135bd3..a135bd3 100644
--- a/squeeze.rb
+++ b/lib/puppet/parser/functions/squeeze.rb
diff --git a/str2bool.rb b/lib/puppet/parser/functions/str2bool.rb
index f3a6d6c..f3a6d6c 100644
--- a/str2bool.rb
+++ b/lib/puppet/parser/functions/str2bool.rb
diff --git a/strip.rb b/lib/puppet/parser/functions/strip.rb
index ebab20e..ebab20e 100644
--- a/strip.rb
+++ b/lib/puppet/parser/functions/strip.rb
diff --git a/swapcase.rb b/lib/puppet/parser/functions/swapcase.rb
index a0002a9..a0002a9 100644
--- a/swapcase.rb
+++ b/lib/puppet/parser/functions/swapcase.rb
diff --git a/upcase.rb b/lib/puppet/parser/functions/upcase.rb
index 8a9769d..8a9769d 100644
--- a/upcase.rb
+++ b/lib/puppet/parser/functions/upcase.rb
diff --git a/zip.rb b/lib/puppet/parser/functions/zip.rb
index 024d64a..024d64a 100644
--- a/zip.rb
+++ b/lib/puppet/parser/functions/zip.rb
diff --git a/member.rb b/member.rb
deleted file mode 100644
index bb43a37..0000000
--- a/member.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# member.rb
-#
-
-# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
-# TODO(Krzysztof Wilczynski): Support for strings and hashes too ...
-
-module Puppet::Parser::Functions
- newfunction(:member, :type => :rvalue, :doc => <<-EOS
- EOS
- ) do |arguments|
-
- raise(Puppet::ParseError, "member(): Wrong number of arguments " +
- "given (#{arguments.size} for 2)") if arguments.size < 2
-
- array = arguments[0]
-
- unless array.is_a?(Array)
- raise(Puppet::ParseError, 'member(): Requires array to work with')
- end
-
- item = arguments[1]
-
- raise(Puppet::ParseError, 'member(): You must provide item ' +
- 'to search for within array given') if item.empty?
-
- result = array.include?(item)
-
- return result
- end
-end
-
-# vim: set ts=2 sw=2 et :