5 module Puppet::Parser::Functions
6 newfunction(:upcase, :type => :rvalue, :doc => <<-EOS
7 Converts a string or an array of strings to uppercase.
19 raise(Puppet::ParseError, "upcase(): Wrong number of arguments " +
20 "given (#{arguments.size} for 1)") if arguments.size < 1
25 unless [Array, String].include?(klass)
26 raise(Puppet::ParseError, 'upcase(): Requires either ' +
27 'array or string to work with')
31 # Numbers in Puppet are often string-encoded which is troublesome ...
32 result = value.collect { |i| i.is_a?(String) ? i.upcase : i }
41 # vim: set ts=2 sw=2 et :