Commit graph

119 commits

Author SHA1 Message Date
Jaume Devesa
fe23e01a4b Add validator for any IP address
Provide a validator for IP addresses, regardless they are IPv4 or IPv6,
and its documentation.
2015-11-30 17:34:00 +01:00
Helen Campbell
99db982741 pick_default addition to readme 2015-11-09 15:14:34 +00:00
Matt Flaschen
1421aa4a87 Fix capitalize docs
Capitalize lower-cases the remaining characters (due to the Ruby function having this behavior); document this, and make minor wording tweaks.
2015-10-27 18:09:18 -04:00
marrero984
2c3c6fde98 (#2183) updated str2bool readme wording 2015-10-22 14:02:13 -07:00
David Schmitt
2db7440c67 Merge pull request #538 from mmckinst/bool2str_enhance
add functionality to bool2str function
2015-10-16 09:31:01 +01:00
Mark McKinstry
6de1a6e062 add functionality to bool2str to return strings of your choice for a boolean 2015-10-15 22:22:10 -04:00
Colleen Murphy
25410c4598 Let load_module_metadata succeed on empty file
Some modules or module versions don't have a metadata.json file, but we
might still want to use the load_module_metadata function on them. The
lack of a file can still give us important information. For example, it
might tell us that the version of the module installed is "very old"
even if we can't read the version number directly. This patch adds a
parameter to let the user specify if an empty file is acceptable. To
preserve backwards compatibility it does not change the current default
behavior, which is to raise an error if metadata.json does not exist.
2015-10-14 16:16:01 -07:00
David Schmitt
ad173f2d05 (MODULES-2421) improve description of file_line
This mostly needed extraction of the existing doc strings from
the type.
2015-10-13 15:03:26 +01:00
Helen Campbell
c7c4d41a82 Added acceptance test and updated readme 2015-09-28 16:18:56 +01:00
David Schmitt
bfa21edbae (FM-3701) Update README for is_a 2015-09-28 11:12:25 +01:00
Helen Campbell
92b068ad20 Adding update to empty function readme 2015-09-23 11:27:48 +01:00
David Schmitt
55ece7815a (MAINT) validate_re: Clarify docs and error message 2015-09-17 18:48:32 +01:00
Bryan Jen
0ea0e40228 Merge pull request #523 from DavidS/modules-2516-is_a
(MODULES-2561) add is_a function
2015-09-14 10:49:50 -07:00
Bryan Jen
c0df8192ee Merge pull request #511 from dmitryilyin/parseyaml_default
[MODULES-2462] Improve parseyaml function
2015-09-14 10:40:35 -07:00
David Schmitt
00c881d0da (MODULES-2516) Adds an is_a() function
The data type system is very hard to understand. Many people don't
understand why

    type_of([1,2,3]) == Array

will fail, but

    type_of([1,2,3]) <= Array

passes. This does a simpler validation that doesn't rely on explicit
data types. Instead, use

    $foo = [1,2,3]
    if $foo.is_a(Array) {
      notify { 'This is an array': }
    }

This is based on code by Ben Ford <ben.ford@puppetlabs.com>.

  * Added acceptance tests
  * Added dispatch
  * Improved unit tests
  * Added docs to README
2015-09-14 18:26:25 +01:00
TP Honey
2a7a93ffb4 Merge pull request #518 from logicminds/case_insensitive
accept any case of boolean strings
2015-09-09 11:20:18 +01:00
Dmitry Ilyin
411978db32 [MAINT] Improve 'try_get_value' readme 2015-09-04 19:24:15 +03:00
Corey Osman
f2f2db4795 accept any case of boolean strings
* previously the str2bool function did not accept 'TRUE' as a bool
    type.  This causes the function to now accept TRUE, FALSE strings
    as a boolean type in order to be converted to a proper boolean.
  * This would also cause Y,N, YES, NO to be accepted as boolean types
    as well.
2015-09-04 08:09:26 -07:00
David Schmitt
64267eb650 Merge pull request #513 from dmitryilyin/fetch
Add a new function "try_get_value"
2015-09-02 09:23:46 +01:00
Dmitry Ilyin
823a352f0f Add a new function "try_get_value"
* Extracts a value from a deeply-nested data structure
* Returns default if a value could not be extracted
2015-09-01 21:45:44 +03:00
fhats
2d4f5aa4d9 Adds a convert_base function, which can convert numbers between bases
Squashed, improved docs, updated error handling and unit tests by David S.
2015-08-27 10:42:13 +01:00
Dmitry Ilyin
eb948c4a0d [MODULES-2462] Improve parseyaml function
* Add default value support
  Second argument will be returned if yaml cannot be parsed
  instead of false value
* Update tests
2015-08-25 21:41:03 +03:00
Jetroid
ba345abfb7 Add consistent *Type* information
Remove trailing whitespace

Two functions had not been given any *Type* information. This commit fixes that.
2015-08-25 10:35:57 +01:00
Jetroid
1d9189d860 (MODULE-2456) Modify union to accept more than two arrays
Add spec tests to test the new functionality:
 *Case for 3 arrays.
 *Case for 4 arrays.
Modify README to note new functionality.

This is for issue MODULE-2456, follow the precedent of MODULE-444.

This change allows union to be much more useful, unioning many arrays
in one line rather than in n lines. Additionally, as this is only added
functionality, and does not affect the 2 array case that all modules
currently using array are using, it should not affect any existing
modules utilizing union.

This is now useful, for example, for merging many arrays of resources
(eg: packages.) to generate just one list with no duplicates, to avoid
duplicate resource declarations.
2015-08-24 14:24:10 +01:00
Nigel Gibbs
4cbe846750 (MODULES-2410) Add new functions dos2unix and unix2dos 2015-08-14 13:30:01 +01:00
Hunter Haugen
e815da5962 Merge pull request #483 from nibalizer/load_metadata_json
Add load_metadata_json function
2015-07-31 14:12:56 -07:00
Spencer Krum
f411ee7119 Add load_metadata_json function
This function loads the metadata.json into a puppet variable. This enables a number of neat things such as:

* Which version of the module am I using? 2.x? 3.x?
* Which author of the module am I using? puppetlabs? example42?
2015-07-30 15:51:54 -07:00
Zee Alexander
aca29129cb Remove colorful language from module. 2015-07-30 15:11:26 -07:00
Raymond Maika
35e92645f7 (MODULES-2024) Adding replace attribute to file_line 2015-07-30 14:55:32 -04:00
gcmalloc
5c79107863 adding support for hash in the size function 2015-07-22 12:11:52 +02:00
Garrett Honeycutt
f485e6e2eb Clarify that third argument to ensure_resource() is a hash 2015-07-12 20:11:36 -04:00
TP Honey
a2026bf13b Merge pull request #475 from DavidS/document-puppet4-compat
Document puppet 4 compatability in 4.6
2015-07-09 18:30:26 +01:00
Alexander Fisher
c64ecfb0c3 Add validate_slength's optional 3rd arg to README 2015-07-09 18:13:19 +01:00
David Schmitt
771320a830 Document puppet 4 compatability in 4.6 2015-06-18 14:51:35 +01:00
Eli Young
d7c8460353 fqdn_rotate: Improve documentation 2015-06-01 16:19:07 -07:00
Raymond Maika
72089f3d13 (MODULES-2071) Refactor file_line provider to contain logic to handle parameter multiple in function handle_create_with_after
Without this, file_line resource without the `match` parameter but with the `after` param will throw an error if there are multiple matches for the after expression. This patch creates the handling for the `multiple` parameter in handle_create_with_after. This allows you to add a line after the `after` expression if it appears at multiple points in a file.

Updated reference to `file_line` in the README to reflect that the multiple parameter can be set when using `after` and/or `match` as the matching regex.
2015-05-29 00:30:44 -04:00
Jorie Tappa
593f74ced7 DOC-1504: README edits 2015-05-14 15:03:23 -07:00
Hunter Haugen
8fba5c058b Merge pull request #405 from elyscape/feature/fqdn_rand_strings
(MODULES-1715) Add FQDN-based random string generator
2015-04-09 10:45:38 -07:00
Eli Young
23be4020dd (MODULES-1737) Add pw_hash() function 2015-04-05 17:21:17 -07:00
Eli Young
a82266c256 (MODULES-1715) Add fqdn_rand string generators 2015-03-31 17:33:04 -07:00
Spencer Krum
c297bd80e3 Make each function a link in the readme
Using a ####, github will create a link. This makes it so I can link
someone directly to the function I want to show them.
2015-03-28 20:34:42 -07:00
TP Honey
bf8e5b0573 Merge pull request #422 from cyberious/assert_private
Assert private
2015-03-05 19:15:41 +00:00
Franz Pletz
56d815bcfc Rename private() to assert_private()
As mentioned in #270, private is a reserved keyword in the future parser
which is to be released with Puppet 4. As it stands, this function is
not useable with the future parser so it needs to renamed.

This is a breaking change.
2015-03-05 10:59:31 -08:00
Hunter Haugen
41965fd2c9 Merge pull request #375 from poikilotherm/feature/master/validate_integer_and_numeric
(MODULES-560) Add new functions validate_numeric() and validate_integer().
2015-03-05 10:57:43 -08:00
TP Honey
706b9e8205 Merge pull request #420 from mhaskel/improveprefix
Add support for hashes in the prefix function
2015-03-05 15:45:39 +00:00
robruma
380cb02a65 Adding markdown for the range() function's 3rd argument
Adding markdown for the range() function's 3rd argument

Adding markdown for the range() function's 3rd argument
2015-03-04 18:01:29 -05:00
Stefan Goethals
0236cd51bc Add support for hashes in the prefix function
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2015-03-03 16:20:55 -08:00
Morgan Haskel
055083c117 Merge pull request #407 from adamcrews/ceiling_function
Add a ceiling function to complement the floor function.
2015-03-03 15:59:06 -08:00
Travis Fields
85e81f9bdf Loosen the restrictions of upcase and allow for recursion of the objects and only worry if the object responds to upcase 2015-03-02 10:45:43 -08:00
Spencer Krum
ef539388cb Remove travis badge 2015-02-19 13:58:14 -08:00