5 module Puppet::Parser::Functions
6 newfunction(:rstrip, :type => :rvalue, :doc => <<-EOS
7 Strips leading spaces to the right of the string.
11 raise(Puppet::ParseError, "rstrip(): Wrong number of arguments " +
12 "given (#{arguments.size} for 1)") if arguments.size < 1
16 unless value.is_a?(Array) || value.is_a?(String)
17 raise(Puppet::ParseError, 'rstrip(): Requires either ' +
18 'array or string to work with')
22 result = value.collect { |i| i.is_a?(String) ? i.rstrip : i }
31 # vim: set ts=2 sw=2 et :