Without this patch the resource whole_line would be included in the
stable stdlib module shipping in PE 1.2. Ideally the name will be
stable and unchanging in the future.
There was quite a bit of concern over whole_line being an unwise name.
file_line appears to be the most suitable name and least likely to need
another rename in the future.
The accounts module is making use of validate_array() and
validate_string() which do not exist int he stdlib module without this
patch.
This patch adds the two functions to the stdlib with unit tests.
Reviewed-by: Dan Bode
In Puppet, it is not possible to reassign hash
values.
This function allows a reasonable way to perform
hash munging in Puppet.
Reviewed-by: Jeff McCune
It is difficult to use existance of keys in a hash
as a boolean condition in Puppet (see #8705)
This function provides a working solution until
the underlying issue in Puppet can be resolved.
Reviewed-by: Jeff McCune
This commit adds a native type that can check if
a line exists and append it to a file.
This use case seems common enough to warrant its
inclusion into stdlib.
Reviewed-by: Jeff McCune
These tests run through a number of example cases and exercise the
behavior of the validate_hash function.
To run, simple execute rspec validate_hash_spec.rb
This isn't directly related to #8010, but rather indirectly fills the
need to allow the end user to configure where data values are looked up.
This allows the namespace to be passed as a class parameter. A module
may then quickly and easily look up data from the user-defined
namespace.
Unlike the whit type the anchor type derives from, we are not hacking
the stringify method. We expect the resource to be named simply
Anchor[foo::bar] where the name is "foo::bar".
This is an interesting spec test for module developers.
It illustrates how to cause Puppet to test the function
from the Puppet DSL rather than the Ruby DSL, fully
exercising the system from the perspective of the end
user.
(Note how Puppet[:code] is set, then the scope reset, then
the compile method called.)
Paired-with: Dan Bode <dan@puppetlabs.com>