# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
#
modulePuppet::Parser::Functions
newfunction(:camelcase,type: :rvalue,doc: <<-DOC
@summary
**Deprecated** Converts the case of a string or all strings in an array to camel case.
> *Note:*
**Deprecated** from Puppet 6.0.0, this function has been replaced with
a built-in [`camelcase`](https://puppet.com/docs/puppet/latest/function.html#camelcase)
function.
@return [String] The converted String, if it was a String that was given
@return [Array[String]] The converted Array, if it was a Array that was given
DOC
)do|arguments|
raise(Puppet::ParseError,"camelcase(): Wrong number of arguments given (#{arguments.size} for 1)")ifarguments.empty?
value=arguments[0]
klass=value.class
unless[Array,String].include?(klass)
raise(Puppet::ParseError,'camelcase(): Requires either array or string to work with')
end
result=ifvalue.is_a?(Array)
# Numbers in Puppet are often string-encoded which is troublesome ...
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.
#
modulePuppet::Parser::Functions
newfunction(:capitalize,type: :rvalue,doc: <<-DOC
@summary
**Deprecated** Capitalizes the first letter of a string or array of strings.
Requires either a single string or an array as an input.
> *Note:*
**Deprecated** from Puppet 6.0.0, yhis function has been replaced with a
raisePuppet::ParseError,'convert_base(): First argument must be either a string or an integer'unlessargs[0].is_a?(Integer)||args[0].is_a?(String)
raisePuppet::ParseError,'convert_base(): Second argument must be either a string or an integer'unlessargs[1].is_a?(Integer)||args[1].is_a?(String)
ifargs[0].is_a?(String)
raisePuppet::ParseError,'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10'unless%r{^[0-9]+$}.match?(args[0])
end
ifargs[1].is_a?(String)
raisePuppet::ParseError,'convert_base(): First argument must be an integer or a string corresponding to an integer in base 10'unless%r{^[0-9]+$}.match?(args[1])
end
number_to_convert=args[0]
new_base=args[1]
number_to_convert=number_to_convert.to_i
new_base=new_base.to_i
raisePuppet::ParseError,'convert_base(): base must be at least 2 and must not be greater than 36'unlessnew_base>=2&&new_base<=36
# Please note: This function is an implementation of a Ruby class and as such may not be entirely UTF8 compatible. To ensure compatibility please use this function with Ruby 2.4.0 or greater - https://bugs.ruby-lang.org/issues/10085.