]> gitweb.fluxo.info Git - puppet-stdlib.git/log
puppet-stdlib.git
12 years agoAllow concat to take non-array second parameters
Martin Foot [Fri, 21 Feb 2014 14:32:32 +0000 (14:32 +0000)]
Allow concat to take non-array second parameters

Also improve and extend concat tests to lock down functionality

12 years agohash example has misplaced comas
Juan Treminio [Thu, 20 Feb 2014 05:37:38 +0000 (23:37 -0600)]
hash example has misplaced comas

12 years agoPUP-1724 Don't modify the paramaters to deep_merge
Justin Burnham [Mon, 17 Feb 2014 19:46:55 +0000 (11:46 -0800)]
PUP-1724 Don't modify the paramaters to deep_merge

Instead of modifying the first paramater of deep_merge due to the
use of the merge! function, instead use merge to return a copy of
the merged object. This allows one to continue to use the original
first parameter after the call to deep_merge.

12 years agoMerge pull request #217 from teancom/fix/master/file_line
Ashley Penney [Tue, 11 Feb 2014 17:51:37 +0000 (12:51 -0500)]
Merge pull request #217 from teancom/fix/master/file_line

(DOCUMENT-21) add docs for file_line to README.markdown

12 years agoMerge pull request #219 from petems/patch-1
Ashley Penney [Tue, 11 Feb 2014 17:51:22 +0000 (12:51 -0500)]
Merge pull request #219 from petems/patch-1

Fix strftime documentation in README

12 years agoFix strftime documentation in README
Peter Souter [Tue, 11 Feb 2014 15:57:22 +0000 (15:57 +0000)]
Fix strftime documentation in README

Markdown was barfing due to typo

12 years agoMerge pull request #218 from mediatemple/remove_trailing_whitespace
Hunter Haugen [Wed, 5 Feb 2014 23:06:09 +0000 (15:06 -0800)]
Merge pull request #218 from mediatemple/remove_trailing_whitespace

Remove trailing whitespace

12 years agoRemove trailing whitespace
Sharif Nassar [Wed, 5 Feb 2014 23:01:45 +0000 (15:01 -0800)]
Remove trailing whitespace

12 years agoMerge branch 'DavidS-broaden-pick-arguments2'
Andrew Parker [Wed, 29 Jan 2014 17:28:48 +0000 (09:28 -0800)]
Merge branch 'DavidS-broaden-pick-arguments2'

* DavidS-broaden-pick-arguments2:
  (PUP-638) Add a pick_default() function that always returns a value.
  (PUP-636) Ignore generated file

12 years ago(PUP-638) Add a pick_default() function that always returns a value.
David Schmitt [Thu, 23 Jan 2014 14:22:27 +0000 (15:22 +0100)]
(PUP-638) Add a pick_default() function that always returns a value.

This version of pick() does not error out, instead always returning at least
the last argument, even if that too has no "real" value.

12 years ago(PUP-636) Ignore generated file
David Schmitt [Wed, 14 Aug 2013 08:33:39 +0000 (10:33 +0200)]
(PUP-636) Ignore generated file

12 years agoMerge pull request #215 from blkperl/add_root_home_to_mavericks
Andrew Parker [Tue, 28 Jan 2014 18:52:58 +0000 (10:52 -0800)]
Merge pull request #215 from blkperl/add_root_home_to_mavericks

(PUP-1459) Add support for root_home on OS X 10.9

12 years ago(DOCUMENT-21) add docs for file_line to README.markdown
David Bishop [Sat, 25 Jan 2014 18:23:17 +0000 (13:23 -0500)]
(DOCUMENT-21) add docs for file_line to README.markdown

Without this, you have to look at the source file
(lib/puppet/type/file_line.rb) to know what it does. This adds that
documentation.

12 years ago(PUP-1195) Rephrase documentation for is_integer and is_numeric
Henrik Lindberg [Thu, 23 Jan 2014 23:22:09 +0000 (00:22 +0100)]
(PUP-1195) Rephrase documentation for is_integer and is_numeric

The documentation contained references to future decisions about
functionality.
Text rephrased for clarity.

12 years ago(PUP-1195) Fix is_numeric/is_integer when checking non-string parameters
Simon Effenberg [Thu, 19 Dec 2013 23:13:39 +0000 (00:13 +0100)]
(PUP-1195) Fix is_numeric/is_integer when checking non-string parameters

I expect a function called "is_numeric" or "is_integer" to check if a
variable is an integer or a number even if the variable passed by isn't
a string nor a number at all. Otherwise we should call them
is_string_a_number and is_string_an_integer and we have then to remove
the check for .is_a?(Number) and .is_a?(FixNum)

now checking also if it is a hex or octal number

improved/corrected checking for integer

* checking against Integer instead of Fixnum so that
  also Bignum is matching
* now .is_a? Integer is done first so this is quiet fast

Now many types of numerics are recognized.

1. Float/Integer values (signed or unsigned, with exponent or without)
2. octal and hex check
3. except hex numbers and the "0." in a float lower than 1 can be prefixed
   with a '0'.

whitespaces shouldn't be allowed as prefix/suffix

string representation of numbers should not contain any type of
whitespace.. the user is responsible to clean a string before checking
it..

fix documentation and added more checks

tried to be 99.9% backward compatible

* for now the decission is post poned if hex and octal numbers
  should be allowed or not (is_numeric)
* native Bignum is now also a valid integer class

fix problem with old 1.8 ruby and Hash.to_s/Array.to_s

In ruby < 1.9 array and hashes would be recognized as numeric
if they have a special format:

1.8:

  [1,2,3,4].to_s = "1234"
  {1=>2}.to_s    = "12"

1.9:

  [1,2,3,4].to_s = "[1, 2, 3, 4]"
  {1=>2}.to_s    = "{1=>2}"

12 years agoMerge pull request #216 from ghoneycutt/enable_travis_fast_finish
Hunter Haugen [Thu, 23 Jan 2014 22:49:56 +0000 (14:49 -0800)]
Merge pull request #216 from ghoneycutt/enable_travis_fast_finish

Enable fast finish in Travis

12 years agoEnable fast finish in Travis
Garrett Honeycutt [Thu, 23 Jan 2014 19:18:50 +0000 (14:18 -0500)]
Enable fast finish in Travis

http://blog.travis-ci.com/2013-11-27-fast-finishing-builds/

12 years ago(PUP-1459) Add support for root_home on OS X 10.9
William Van Hevelingen [Fri, 17 Jan 2014 06:22:38 +0000 (22:22 -0800)]
(PUP-1459) Add support for root_home on OS X 10.9

getent does not exist on 10.9 so this commit uses
dscacheutil to query the homedir for the root user.

12 years agoMerge branch 'pull-201'
Adrien Thebo [Wed, 15 Jan 2014 19:17:48 +0000 (11:17 -0800)]
Merge branch 'pull-201'

This closes GH-201.

12 years ago(maint) Update ensure_package specs to confirm expected behavior
Adrien Thebo [Wed, 15 Jan 2014 19:04:03 +0000 (11:04 -0800)]
(maint) Update ensure_package specs to confirm expected behavior

The previous behavior of the tests checked the behavior of the
underlying functions library when called with no arguments; this commit
updates the tests to conform to the functions API and test what happens
when a function is called with no args.

12 years ago(maint) refactor ensure_packages for clarity
Adrien Thebo [Wed, 15 Jan 2014 19:03:49 +0000 (11:03 -0800)]
(maint) refactor ensure_packages for clarity

12 years agoAllow a single argument, rather than an array
Tomas Doran [Tue, 19 Nov 2013 18:38:12 +0000 (18:38 +0000)]
Allow a single argument, rather than an array

12 years agoMerge pull request #214 from zaphod42/maint/master/update-references-for-jira
Andrew Parker [Thu, 26 Dec 2013 17:36:44 +0000 (09:36 -0800)]
Merge pull request #214 from zaphod42/maint/master/update-references-for-jira

(doc) Update to point to Jira

12 years ago(doc) Update to point to Jira
Andrew Parker [Mon, 23 Dec 2013 23:35:08 +0000 (15:35 -0800)]
(doc) Update to point to Jira

Since we've moved from Redmine to Jira the links need to be updated so
that people know where to look for issues.

At the moment stdlib is being tracked with puppet in the PUP project.
This doesn't seem like a good, long term solution, but it is where we
are right now.

12 years agoMerge branch 'pull-209'
Adrien Thebo [Fri, 20 Dec 2013 23:04:18 +0000 (15:04 -0800)]
Merge branch 'pull-209'

This closes GH-209

12 years ago(maint) Improve test coverage for prefix and suffix
Adrien Thebo [Fri, 20 Dec 2013 22:59:51 +0000 (14:59 -0800)]
(maint) Improve test coverage for prefix and suffix

12 years agoFix prefix exception message (Closes #23364)
Franco Catena [Thu, 5 Dec 2013 19:11:59 +0000 (16:11 -0300)]
Fix prefix exception message (Closes #23364)

12 years ago(Maint) Update stubbing to work with facter 1.7.4
Andrew Parker [Wed, 18 Dec 2013 22:46:54 +0000 (14:46 -0800)]
(Maint) Update stubbing to work with facter 1.7.4

Facter 1.7.4 changed how it decides on what directory to look in for
facts.d based on the user it is running as. This stubs out that bit of
code to make it think it is running as root.

12 years agoMerge pull request #211 from jhoblitt/function_is_bool
Andrew Parker [Wed, 18 Dec 2013 18:49:39 +0000 (10:49 -0800)]
Merge pull request #211 from jhoblitt/function_is_bool

(#23381) add is_bool() function

12 years agoMerge pull request #208 from ghoneycutt/add_validation
Andrew Parker [Wed, 18 Dec 2013 18:45:10 +0000 (10:45 -0800)]
Merge pull request #208 from ghoneycutt/add_validation

Add rake tasks to validate and lint files and check with Travis

12 years agoMerge pull request #207 from ghoneycutt/remove_unintentional_link
Josh Cooper [Wed, 18 Dec 2013 18:38:40 +0000 (10:38 -0800)]
Merge pull request #207 from ghoneycutt/remove_unintentional_link

Remove unintentional link from README

12 years agoMerge pull request #203 from dreamlibrarian/fix/is_function_available-ruby_c
Andrew Parker [Wed, 18 Dec 2013 18:31:39 +0000 (10:31 -0800)]
Merge pull request #203 from dreamlibrarian/fix/is_function_available-ruby_c

calling rspec directly makes is_function_available.rb not pass ruby -c

12 years ago(maint) Update README stating stdlib 4.x supports Puppet 2.7.x
Jeff McCune [Thu, 12 Dec 2013 16:12:12 +0000 (11:12 -0500)]
(maint) Update README stating stdlib 4.x supports Puppet 2.7.x

Without this patch there is a disconnect between the documentation in
the README and our decision to not merge pull requests into the 4.x
series that break compatibility with Puppet 2.7.x

For example:

    @jeffmccune I think the real issue here is that "policy" is out of sync with
    the documentation. The README claims that 4.x does not support puppet 2.7.x,
    yet the "policy" is not to merge patches that break 2.7.x. Due to that I'm sure
    there are a lot of 2.7.x installations out there that have a 4.x version of
    stdlib installed. That's going to cause a rather rude surprise if some future
    version of 4.x stops working where a prior minor release was functioning.

    I'd like to suggest that the documentation be changed to reflect 4.x supporting
    2.7.x and that a new major version bump is made when 2.7.x support can in fact
    be dropped. An alternative solution would be update the README with a note to
    developers about the kinda/sorta/maybe/fishy/quasi support of 2.7.x.

Please also see this discussion:
https://github.com/puppetlabs/puppetlabs-stdlib/pull/176#issuecomment-30251414

12 years agoMerge pull request #200 from bobtfish/fix_tests_on_osx
Adrien Thebo [Mon, 9 Dec 2013 22:18:17 +0000 (14:18 -0800)]
Merge pull request #200 from bobtfish/fix_tests_on_osx

Fix the tests on osx

12 years ago(#23381) add is_bool() function
Joshua Hoblitt [Mon, 9 Dec 2013 18:45:50 +0000 (11:45 -0700)]
(#23381) add is_bool() function

12 years agoMerge pull request #210 from apenney/temp-fix
Kylo Ginsberg [Sat, 7 Dec 2013 16:48:24 +0000 (08:48 -0800)]
Merge pull request #210 from apenney/temp-fix

Pin rspec-puppet to 0.1.6 for now as the change to 1.0.0 has broken

12 years agoPin rspec-puppet to 0.1.6 for now as the change to 1.0.0 has broken
Ashley Penney [Fri, 6 Dec 2013 23:50:09 +0000 (18:50 -0500)]
Pin rspec-puppet to 0.1.6 for now as the change to 1.0.0 has broken
things involving Mocha badly.

12 years agoAdd rake tasks to validate and lint files and check with Travis
Garrett Honeycutt [Sat, 30 Nov 2013 16:18:43 +0000 (11:18 -0500)]
Add rake tasks to validate and lint files and check with Travis

This patch adds the ability to validate syntax of manifests, templates,
and ruby files in lib/ via `rake validate` and the linting of manifests
with puppet-lint via `rake lint`. These two commands are chained with
running the spec tests in Travis to ensure there are no syntax or style
issues.

12 years agoRemove unintentional link from README
Garrett Honeycutt [Sat, 30 Nov 2013 15:40:27 +0000 (10:40 -0500)]
Remove unintentional link from README

Markdown interprets [] folowed by () as a link, which was a 404 and not
the intention of the original author. This patch ensures that the
document reads as intended, without the link.

12 years agocalling rspec directly makes this not pass ruby -c. adjusting to be in line with...
Tristan Smith [Thu, 21 Nov 2013 02:30:46 +0000 (18:30 -0800)]
calling rspec directly makes this not pass ruby -c. adjusting to be in line with the rest.

12 years agoFix the tests on osx
Tomas Doran [Tue, 19 Nov 2013 18:42:19 +0000 (18:42 +0000)]
Fix the tests on osx

12 years agoMerge branch 'fix/master/add_recursive_merge'
Josh Partlow [Tue, 29 Oct 2013 19:15:42 +0000 (12:15 -0700)]
Merge branch 'fix/master/add_recursive_merge'

* fix/master/add_recursive_merge:
  (#20200) Add a recursive merge function.

Closes GH-189

This patch changes the original pull request to draw in the overlay function as
a Proc and make use of Hash.merge {} for resolving key conflicts.

12 years ago(#20200) Add a recursive merge function.
Justin Burnham [Tue, 24 Sep 2013 17:57:15 +0000 (10:57 -0700)]
(#20200) Add a recursive merge function.

Issue #20200 notes that the merge function does not
support nested hashes.

To prevent unintended side effects with changing merge,
add a deep_merge function instead.

12 years agoMerge branch 'fix-pick-error-typo'
Josh Cooper [Tue, 29 Oct 2013 19:01:39 +0000 (12:01 -0700)]
Merge branch 'fix-pick-error-typo'

* fix-pick-error-typo:
  (Main) fix typo in pick error message

Closes GH-197

12 years ago(Main) fix typo in pick error message
Matthew Haughton [Tue, 29 Oct 2013 18:21:03 +0000 (14:21 -0400)]
(Main) fix typo in pick error message

Update pick error message "at least one non empty value"

12 years agoMerge remote-tracking branch 'tchaudhri/tchaudhri_join_func_doc_typo'
Josh Cooper [Tue, 29 Oct 2013 18:10:12 +0000 (11:10 -0700)]
Merge remote-tracking branch 'tchaudhri/tchaudhri_join_func_doc_typo'

* tchaudhri/tchaudhri_join_func_doc_typo:
  Fixed 'separator' typos

Closes GH-196

12 years agoFixed 'separator' typos
Tehmasp Chaudhri [Fri, 25 Oct 2013 21:26:21 +0000 (15:26 -0600)]
Fixed 'separator' typos

12 years agoMerge branch 'pull-180'
Adrien Thebo [Thu, 19 Sep 2013 04:56:16 +0000 (21:56 -0700)]
Merge branch 'pull-180'

This closes GH-180

12 years ago(maint) Simplify validate_cmd specs
Adrien Thebo [Thu, 19 Sep 2013 04:48:45 +0000 (21:48 -0700)]
(maint) Simplify validate_cmd specs

12 years ago(#22214): close content file before executing checkscript
sgzijl [Mon, 9 Sep 2013 14:20:36 +0000 (16:20 +0200)]
(#22214): close content file before executing checkscript

Right now validation seems to be done against zero byte generated temp
files. We need to close the file before executing validation against it.

12 years agoMerge pull request #184 from lmello/fix_bug_20681_delete_undef_values
Adrien Thebo [Wed, 18 Sep 2013 17:08:49 +0000 (10:08 -0700)]
Merge pull request #184 from lmello/fix_bug_20681_delete_undef_values

delete_undef_values function fix bug #20681

12 years ago(#20681) fix behaviour of delete_undef_values
Leonardo Rodrigues de Mello [Mon, 16 Sep 2013 14:08:13 +0000 (11:08 -0300)]
(#20681) fix behaviour of delete_undef_values

The issue #20681 describe the error of delete() function
removing the elements from the origin array/hash/string.

This issue affected other delete functions. Because
ruby delete and delete_if functions make destructive
changes to the origin array/hash.

The delete_undef_values removed elements from the
origin array/hash and this is not the desired behaviour.

To solve this, we should dup or clone the array/hash
before using the delete or delete_if ruby functions.

We should also check if args[0] is not nil before using
dup, since dup on nil raises exception.

This fix the problem and add unit tests, so we could
enforce this behaviour and prevent regressions.

12 years agoMerge pull request #183 from lmello/fix_bug_20681_delete_at
Adrien Thebo [Tue, 17 Sep 2013 18:39:29 +0000 (11:39 -0700)]
Merge pull request #183 from lmello/fix_bug_20681_delete_at

delete_at added spec to check against bug #20681

12 years agoMerge pull request #182 from lmello/fix_bug_20681_delete_values
Adrien Thebo [Tue, 17 Sep 2013 18:35:57 +0000 (11:35 -0700)]
Merge pull request #182 from lmello/fix_bug_20681_delete_values

delete_values() fix bug #20681.

12 years agoMerge pull request #185 from lmello/refactor_16498
Adrien Thebo [Tue, 17 Sep 2013 18:33:57 +0000 (11:33 -0700)]
Merge pull request #185 from lmello/refactor_16498

(#16498) Added unit test for loadyaml function.

12 years ago(#16498) Added unit test for loadyaml function.
Leonardo Rodrigues de Mello [Tue, 17 Sep 2013 14:10:00 +0000 (11:10 -0300)]
(#16498) Added unit test for loadyaml function.

As stated on the issue #16498, it would be great to have unit tests
for all the functions.

Function loadyaml was missing a unit test. This commit added the
unit test to loadyaml function.

12 years agoMerge pull request #178 from lmello/fix_bug_20681
Adrien Thebo [Tue, 17 Sep 2013 18:07:21 +0000 (11:07 -0700)]
Merge pull request #178 from lmello/fix_bug_20681

 bug # 20681 delete() function should not remove elements from original list

12 years ago(#20681) delete_at function unit test against issue
Leonardo Rodrigues de Mello [Mon, 16 Sep 2013 13:51:15 +0000 (10:51 -0300)]
(#20681) delete_at function unit test against issue

The issue #20681 describe the error of delete() function
removing the elements from the origin array/hash/string.

This issue affected the other delete functions.

The delete_at function is not afected by this bug, but
it did not had the unit test to check against it.

I had added the unit test so we could prevent regressions
on the future and also have better test coverage.

12 years ago(#20681) fix behaviour of delete_values
Leonardo Rodrigues de Mello [Mon, 16 Sep 2013 13:33:58 +0000 (10:33 -0300)]
(#20681) fix behaviour of delete_values

The issue #20681 describe the error of delete() function
removing the elements from the origin array/hash/string.

This issue affected other delete functions. Because
ruby delete and delete_if functions make destructive
changes to the origin array/hash.

The delete_undef_values removed elements from the
origin hash and this is not the desired behaviour.

To solve this, we should dup or clone the hash
before using the delete or delete_if ruby functions.

This fix the problem and add unit tests, so we could
enforce this behaviour and prevent regressions.

12 years agoMerge pull request #179 from lmello/function_pick_error_msg
Adrien Thebo [Mon, 16 Sep 2013 20:45:24 +0000 (13:45 -0700)]
Merge pull request #179 from lmello/function_pick_error_msg

enhanced the error message of pick function.

12 years agobug # 20681 delete() function should not remove elements from original list
Leonardo Rodrigues de Mello [Mon, 9 Sep 2013 13:27:54 +0000 (10:27 -0300)]
bug # 20681 delete() function should not remove elements from original list

The setup: list with 3 elements, delete one:
$test_list = [‘a’, ‘b’, ‘c’]
$test_deleted = delete($test_list, ‘a’)

Print out the elements in ‘test_deleted’:
notify { ‘group_output2’:  withpath => true, name     => “$cfeng::test_deleted”, }
Notice: /Stage[main]/Syslog/Notify[group_output2]/message: bc

Good!  Run-on output shows that ‘a’ was deleted

Print out the elements in ‘test_list’:
notify { ‘group_output1’: withpath => true, name     => “$cfeng::test_list”, }
Notice: /Stage[main]/Syslog/Notify[group_output1]/message: bc

WHAT!?  'a' was deleted from ‘test_list’ as well! Expected abc as output!

This behaviour is confirmed for string, hash and array.
This is fixed on this commit, I had  added two spec tests to cover that cases.

bug #20681 spec test for delete() function.

I had forgot in the last commit the spec test for hash in the
delete function.

bug # 20681 delete() function change aproach.

Instead of rejecting elements from the original list, we use
collection = arguments[0].dup .
then latter we could continue to use delete and gsub! on collection
without impact on original argument.

this is a better solution than the previous one, and works on ruby
1.8.7, 1.9.3 and 2.0.0.

The previous solution does not work on ruby 1.8.7.

delete function remove typo whitespace.

fix typo whitespaces.

12 years agoenhanced the error message of pick function.
Leonardo Rodrigues de Mello [Fri, 6 Sep 2013 13:53:47 +0000 (10:53 -0300)]
enhanced the error message of pick function.

When pick function fail return a better error message like
the other stdlib functions, indicating that the error
is on function pick.

This would help people that see the error to identity it is
related to a incorrect use of stdlib function pick, instead of having
to grep all puppet libraries and manifests source for the old message.

I had also changed the spec test.

pick function change spec  as suggested GH-179

Fix the spec test to use expect {}.to instead of lambda {}.should
as explained by Adrienthebo.

"Using expect { }.to is preferred over lambda { }.should.
 In addition it's best practice to do a string match against the
error message to ensure that we're catching the right error,
instead of any error of the right type."

Also fixed a typo on the error message, it was missing one space.

pick function stylish fix as suggested on GH179

12 years agoMerge pull request #181 from nibalizer/grammar
Adrien Thebo [Thu, 12 Sep 2013 16:57:28 +0000 (09:57 -0700)]
Merge pull request #181 from nibalizer/grammar

Minor grammar fix

12 years agoMinor grammar fix
Spencer Krum [Wed, 11 Sep 2013 22:37:59 +0000 (15:37 -0700)]
Minor grammar fix

12 years agoMerge pull request #175 from floatingatoll/patch-1
Adrien Thebo [Wed, 11 Sep 2013 18:13:28 +0000 (11:13 -0700)]
Merge pull request #175 from floatingatoll/patch-1

(maint) fix RST formatting of has_interface_with code examples

12 years agoMerge pull request #174 from dprince/file_line_after
Adrien Thebo [Mon, 9 Sep 2013 18:17:16 +0000 (11:17 -0700)]
Merge pull request #174 from dprince/file_line_after

Update file_line resource to support 'after'.

12 years ago(maint) fix RST formatting of has_interface_with code examples
floatingatoll [Wed, 4 Sep 2013 17:26:14 +0000 (10:26 -0700)]
(maint) fix RST formatting of has_interface_with code examples

12 years ago(maint) Improve the tests and readability of file_line
Jeff McCune [Thu, 29 Aug 2013 23:27:27 +0000 (16:27 -0700)]
(maint) Improve the tests and readability of file_line

Without this patch the implementation of the file_line provider is a bit
convoluted with respect to the newly introduced "after" parameter.

This patch addresses the problem by separating out the concerns of each
case into their own methods of handling the behavior with the match
parameter, handling the behavior with the after parameter, or simply
appending the line.

12 years agoUpdate file_line resource to support 'after'.
Dan Prince [Thu, 29 Aug 2013 16:19:16 +0000 (12:19 -0400)]
Update file_line resource to support 'after'.

When adding new lines to a file the 'after' option can be useful
when you need to insert file lines into the middle of a file.

This is particularly helpful when using file_line with sectioned
config files.

NOTE: the after option only works when adding new lines. If you are
updating an existing (matched) line it will simply modify it in place.
This assumes it was in the right place to begin with.

12 years ago(maint) Fix failing spec test with Puppet 3.3.0-rc2
Jeff McCune [Thu, 29 Aug 2013 19:54:14 +0000 (12:54 -0700)]
(maint) Fix failing spec test with Puppet 3.3.0-rc2

Without this patch the stdlib spec tests are failing against recent
versions of Puppet.  The root cause of this problem is a change in the
behavior of create_resources in Puppet 6baa57b.  The change in behavior
caused the :name key to be omitted from the hash returned by
Puppet::Parser::Resource#to_hash which in turn is causing the test
failure.

This patch addresses the problem by updating the test to match the
description of the example.  Only the attribute :ensure is checked
instead of the full hash itself.

12 years ago(maint) Fix location_for helper method
Jeff McCune [Thu, 29 Aug 2013 19:59:44 +0000 (12:59 -0700)]
(maint) Fix location_for helper method

Without this patch the location_for helper method in the Gemfile
incorrectly assumes the mdata variable has a value.  This patch
addresses the problem by explicitly binding the regular expression match
results to the mdata variable to ensure it has a value when accessed by
index.

12 years agoMerge pull request #172 from ptomulik/fix/delete_xxx_spec
Adrien Thebo [Wed, 28 Aug 2013 22:39:32 +0000 (15:39 -0700)]
Merge pull request #172 from ptomulik/fix/delete_xxx_spec

small fix to delete_values_spec.rb and README.markdown

12 years agosmall fix to delete_values_spec.rb and README.markdown
Paweł Tomulik [Wed, 14 Aug 2013 00:23:36 +0000 (02:23 +0200)]
small fix to delete_values_spec.rb and README.markdown

12 years agoMerge pull request #170 from ptomulik/fix_delete_values
Adrien Thebo [Tue, 13 Aug 2013 17:27:42 +0000 (10:27 -0700)]
Merge pull request #170 from ptomulik/fix_delete_values

minor corrections to delete_values()

12 years agoMerge branch 'maint-refactor_validate_slength'
Adrien Thebo [Mon, 12 Aug 2013 19:57:55 +0000 (12:57 -0700)]
Merge branch 'maint-refactor_validate_slength'

12 years ago(maint) Validate input argument in a single location
Adrien Thebo [Mon, 12 Aug 2013 19:52:17 +0000 (12:52 -0700)]
(maint) Validate input argument in a single location

12 years ago(maint) refactor validate_slength tests
Adrien Thebo [Mon, 12 Aug 2013 19:48:46 +0000 (12:48 -0700)]
(maint) refactor validate_slength tests

12 years ago(maint) reindent case statement to match standard indentation
Adrien Thebo [Mon, 12 Aug 2013 18:51:36 +0000 (11:51 -0700)]
(maint) reindent case statement to match standard indentation

12 years ago(maint) collapse String/Array validation into shared lambda
Adrien Thebo [Mon, 12 Aug 2013 18:50:55 +0000 (11:50 -0700)]
(maint) collapse String/Array validation into shared lambda

12 years ago(maint) clean up validate_slength argument validation
Adrien Thebo [Mon, 12 Aug 2013 18:27:56 +0000 (11:27 -0700)]
(maint) clean up validate_slength argument validation

12 years ago(maint) reword error messages for validate_slength
Adrien Thebo [Mon, 12 Aug 2013 18:20:46 +0000 (11:20 -0700)]
(maint) reword error messages for validate_slength

12 years ago(maint) Explicitly unpack validate_slength args
Adrien Thebo [Mon, 12 Aug 2013 18:08:35 +0000 (11:08 -0700)]
(maint) Explicitly unpack validate_slength args

12 years ago(maint) Remove unneeded parens around exceptions
Adrien Thebo [Mon, 12 Aug 2013 18:00:27 +0000 (11:00 -0700)]
(maint) Remove unneeded parens around exceptions

12 years agoMerge pull request #169 from hdeheer/patch-1
Adrien Thebo [Mon, 12 Aug 2013 17:49:47 +0000 (10:49 -0700)]
Merge pull request #169 from hdeheer/patch-1

Fix validate_slength, arg.length should be args[0].length

12 years agominor corrections to delete_values()
Paweł Tomulik [Thu, 8 Aug 2013 14:56:32 +0000 (16:56 +0200)]
minor corrections to delete_values()

12 years agoFix validate_slength, arg.length should be args[0].length
Hubert [Thu, 8 Aug 2013 10:56:12 +0000 (12:56 +0200)]
Fix validate_slength, arg.length should be args[0].length

During a puppet run an error will be thrown and a puppet run will fail completely (when using validate_slength):
undefined local variable or method `arg' for #<Puppet::Parser::Scope:0x7f243c236948>

12 years agoMerge pull request #167 from mhellmic/minlength
Adrien Thebo [Tue, 6 Aug 2013 16:48:44 +0000 (09:48 -0700)]
Merge pull request #167 from mhellmic/minlength

extend the validate_slength function to accept a minimum length

12 years agochanged the validate_slength function to accept a min length
Martin Hellmich [Fri, 28 Jun 2013 16:03:37 +0000 (18:03 +0200)]
changed the validate_slength function to accept a min length

An optional third parameter can be given a min length. The function
then only passes successfully, if all strings are in the range
min_length <= string <= max_length

update and fix function and unit tests

the check for the minlength has to be written differently
because 0 values should be possible. We now check
a) if the input is convertible, and throw a ParseError and
b) if the input .is_a?(Numeric) and ask for a positive number
it's not as clean as for maxlength, but keeps a similar behaviour

refined the error checking for the min length

try to convert to Integer(args[2]) and fail,
if it's not possible

changed the tests accordingly to the new parameter checking

12 years agoMerge pull request #166 from ptomulik/delete_undef_values
Adrien Thebo [Mon, 5 Aug 2013 22:29:08 +0000 (15:29 -0700)]
Merge pull request #166 from ptomulik/delete_undef_values

Add delete_values() and delete_undef_values() functions

12 years agoadded delete_values() and delete_undef_values() functions
Paweł Tomulik [Mon, 29 Jul 2013 09:30:47 +0000 (11:30 +0200)]
added delete_values() and delete_undef_values() functions

12 years agoMerge branch 'uriescape-use_default_escape_list'
Adrien Thebo [Mon, 22 Jul 2013 20:13:13 +0000 (13:13 -0700)]
Merge branch 'uriescape-use_default_escape_list'

This closes GH-164

12 years agoAdjust to use default URI.escape escape list
Tomas Doran [Tue, 2 Jul 2013 10:18:42 +0000 (11:18 +0100)]
Adjust to use default URI.escape escape list

Conform to RFC per comments on: https://github.com/puppetlabs/puppetlabs-stdlib/pull/164

Conflicts:
lib/puppet/parser/functions/uriescape.rb
spec/unit/puppet/parser/functions/uriescape_spec.rb

12 years agoMerge branch 'pull-163'
Adrien Thebo [Thu, 11 Jul 2013 23:26:45 +0000 (16:26 -0700)]
Merge branch 'pull-163'

This closes GH-163

12 years ago(#21416) Allow file_line to match multiple lines
Alex O'Rielly [Fri, 21 Jun 2013 22:33:44 +0000 (17:33 -0500)]
(#21416) Allow file_line to match multiple lines

Without this commit the file_line type will outright fail if multiple
lines match the given regex. This commit allows the file_line type and
provider to optionally match and modify all matching lines.

Changeset rebased into a single commit by Adrien Thebo <adrien@puppetlabs.com>

12 years agoMerge pull request #165 from tigercomputing/fixes/ensure_resource-doc
Adrien Thebo [Thu, 27 Jun 2013 18:19:39 +0000 (11:19 -0700)]
Merge pull request #165 from tigercomputing/fixes/ensure_resource-doc

ensure_resource: fix documentation typo

12 years agoensure_resource: fix documentation typo
Chris Boot [Thu, 27 Jun 2013 16:51:36 +0000 (17:51 +0100)]
ensure_resource: fix documentation typo

12 years agoMerge pull request #158 from wfarr/validate_ip
Adrien Thebo [Fri, 7 Jun 2013 22:06:41 +0000 (15:06 -0700)]
Merge pull request #158 from wfarr/validate_ip

[#20862] Add functions to validate ipv4 and ipv6 addresses

12 years agoMerge branch 'pull-56'
Adrien Thebo [Tue, 28 May 2013 18:17:29 +0000 (11:17 -0700)]
Merge branch 'pull-56'

12 years ago(maint) Remove syntax decoration from range_spec
Adrien Thebo [Tue, 28 May 2013 18:17:00 +0000 (11:17 -0700)]
(maint) Remove syntax decoration from range_spec

12 years ago(maint) Clean up range_spec error expectation
Adrien Thebo [Tue, 28 May 2013 18:14:28 +0000 (11:14 -0700)]
(maint) Clean up range_spec error expectation

Replace `lambda` with `expect` for making an error expectation

Add an explicit error message in expectation