The previous commit to uriescape() changed the implementation to use the ruby default escape list for URI.escape(), but did not change the call triggered when uriescape() was called on an array, triggering ruby errors.
As per puppetlabs/puppet@292233c, this leaves the global seed in a
deterministic state, which is bad. Puppet::Util.deterministic_rand()
exists to avoid running into this issue, but is only present starting in
Puppet 3.2.0.
The `type()` function will cease to work on the new parser because 'type'
is a reserved keyword. The `type3x()` function may be used to continue
similar functionality, but will be deprecated in favor of the built-in
typing system.
The `type_of()` function has been included to introspect types in the
new parser.
The `match` attribute was validated to match `line`, except that in many
cases (even the example given in the docs) a user would want to match a
line entirely different from the new line.
See comments on the original commit
a06c0d8115
and ask
https://ask.puppetlabs.com/question/14366/file_line-resource-match-problems/
for further examples of confusion.
Currently, the member function allows one to only find if a variable
is part of an array. Sometimes it is useful to find if an array is part
of a bigger array for validation purpose.
This is needed for the future parser which actually treats numbers as
numbers and strings as strings. With this patch you can use range(1,5)
instead of having to quote them like range('1','5').
* We were converting Exabytes to bytes as Petabytes.
* Updated tests to cover ever unit.
* Added note that we're going by the old, inaccurate definitions of
Kilobytes, Megabytes, etc, in that we treat them as powers of 2.
We need to use
unless value.is_a?(String) || value.is_a?(Array)
rather than
klass = value.class
unless [String, Array].include?(klass)
because the klass version enforces type checking which is too strict, and does
not allow us to accept objects wich have extended String (or Array).
For example, generate() function now returns Puppet::Util::Execution::ProcessOutput
which is just a very simple extension of String. While this in it's self was
not intentional (PUP-2306) it is not unreasonable to cope with objects which
extend Strings
simplecov 0.9 dropped ruby 1.8 support, and stdlib is one of the oddball
modules that uses it. So we could probably just remove it and be okay.
(cherry picked from commit a7c129b22d)