]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Corrected function name from chop to strip. Moved to unless from if not
authorKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Sat, 30 Apr 2011 01:43:13 +0000 (02:43 +0100)
committerKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Sat, 30 Apr 2011 01:43:13 +0000 (02:43 +0100)
to improve code clarity.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
strip.rb

index 1bb5c0a28a774d3abddee646c8ed102a48d25718..ebab20e7232866717f34a62b70c8312ae7d7c026 100644 (file)
--- a/strip.rb
+++ b/strip.rb
@@ -3,7 +3,7 @@
 #
 
 module Puppet::Parser::Functions
-  newfunction(:chop, :type => :rvalue, :doc => <<-EOS
+  newfunction(:strip, :type => :rvalue, :doc => <<-EOS
     EOS
   ) do |arguments|
 
@@ -13,8 +13,8 @@ module Puppet::Parser::Functions
     value = arguments[0]
     klass = value.class
 
-    if not [Array, String].include?(klass)
-      raise(Puppet::ParseError, 'strip(): Requires either an ' +
+    unless [Array, String].include?(klass)
+      raise(Puppet::ParseError, 'strip(): Requires either ' +
         'array or string to work with')
     end