Corrected function name from chop to strip. Moved to unless from if not
to improve code clarity. Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
This commit is contained in:
parent
41798020d6
commit
16eec26b0b
1 changed files with 3 additions and 3 deletions
6
strip.rb
6
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue