]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Moved more functions into lib/puppet/parser/functions/
authorKen Barber <ken@bob.sh>
Sat, 30 Apr 2011 14:00:49 +0000 (16:00 +0200)
committerKen Barber <ken@bob.sh>
Sat, 30 Apr 2011 14:00:49 +0000 (16:00 +0200)
30 files changed:
lib/puppet/parser/functions/capitalize.rb [moved from capitalize.rb with 100% similarity]
lib/puppet/parser/functions/chomp.rb [moved from chomp.rb with 100% similarity]
lib/puppet/parser/functions/chop.rb [moved from chop.rb with 100% similarity]
lib/puppet/parser/functions/date.rb [moved from date.rb with 100% similarity]
lib/puppet/parser/functions/delete.rb [moved from delete.rb with 100% similarity]
lib/puppet/parser/functions/downcase.rb [moved from downcase.rb with 100% similarity]
lib/puppet/parser/functions/flatten.rb [moved from flatten.rb with 100% similarity]
lib/puppet/parser/functions/grep.rb [moved from grep.rb with 100% similarity]
lib/puppet/parser/functions/hash.rb [moved from hash.rb with 100% similarity]
lib/puppet/parser/functions/is_float.rb [moved from is_float.rb with 100% similarity]
lib/puppet/parser/functions/is_integer.rb [moved from is_integer.rb with 100% similarity]
lib/puppet/parser/functions/is_numeric.rb [moved from is_numeric.rb with 100% similarity]
lib/puppet/parser/functions/is_valid_domain_name.rb [moved from is_valid_domain_name.rb with 100% similarity]
lib/puppet/parser/functions/is_valid_ip_address.rb [moved from is_valid_ip_address.rb with 100% similarity]
lib/puppet/parser/functions/is_valid_mac_address.rb [moved from is_valid_mac_address.rb with 100% similarity]
lib/puppet/parser/functions/is_valid_netmask.rb [moved from is_valid_netmask.rb with 100% similarity]
lib/puppet/parser/functions/load_json.rb [moved from load_json.rb with 100% similarity]
lib/puppet/parser/functions/load_yaml.rb [moved from load_yaml.rb with 100% similarity]
lib/puppet/parser/functions/lstrip.rb [moved from lstrip.rb with 100% similarity]
lib/puppet/parser/functions/member.rb
lib/puppet/parser/functions/rand.rb [moved from rand.rb with 100% similarity]
lib/puppet/parser/functions/rstrip.rb [moved from rstrip.rb with 100% similarity]
lib/puppet/parser/functions/sort.rb [moved from sort.rb with 100% similarity]
lib/puppet/parser/functions/squeeze.rb [moved from squeeze.rb with 100% similarity]
lib/puppet/parser/functions/str2bool.rb [moved from str2bool.rb with 100% similarity]
lib/puppet/parser/functions/strip.rb [moved from strip.rb with 100% similarity]
lib/puppet/parser/functions/swapcase.rb [moved from swapcase.rb with 100% similarity]
lib/puppet/parser/functions/upcase.rb [moved from upcase.rb with 100% similarity]
lib/puppet/parser/functions/zip.rb [moved from zip.rb with 100% similarity]
member.rb [deleted file]

similarity index 100%
rename from chop.rb
rename to lib/puppet/parser/functions/chop.rb
similarity index 100%
rename from date.rb
rename to lib/puppet/parser/functions/date.rb
similarity index 100%
rename from grep.rb
rename to lib/puppet/parser/functions/grep.rb
similarity index 100%
rename from hash.rb
rename to lib/puppet/parser/functions/hash.rb
index a491a76c500580806311ee16ea6ed463d257c790..bb43a37a09ea0e73b0f9a8f3e44628bd8b347708 100644 (file)
@@ -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)
 
similarity index 100%
rename from rand.rb
rename to lib/puppet/parser/functions/rand.rb
similarity index 100%
rename from sort.rb
rename to lib/puppet/parser/functions/sort.rb
similarity index 100%
rename from zip.rb
rename to lib/puppet/parser/functions/zip.rb
diff --git a/member.rb b/member.rb
deleted file mode 100644 (file)
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 :