5 module Puppet::Parser::Functions
6 newfunction(:lstrip, :type => :rvalue, :doc => <<-EOS
7 Strips leading spaces to the left of a string.
11 raise(Puppet::ParseError, "lstrip(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size < 1
15 unless value.is_a?(Array) || value.is_a?(String)
16 raise(Puppet::ParseError, 'lstrip(): Requires either array or string to work with')
20 # Numbers in Puppet are often string-encoded which is troublesome ...
21 result = value.collect { |i| i.is_a?(String) ? i.lstrip : i }
30 # vim: set ts=2 sw=2 et :