]> gitweb.fluxo.info Git - puppet-stdlib.git/log
puppet-stdlib.git
12 years agoMerge branch 'dalen-count'
Jeff McCune [Wed, 10 Apr 2013 21:40:13 +0000 (14:40 -0700)]
Merge branch 'dalen-count'

* dalen-count:
  (maint) Make stdlib usable as a Ruby GEM
  (maint) Add the behavior for count() with arrays and hashes
  Add a count function

closes #143

12 years ago(maint) Make stdlib usable as a Ruby GEM
Jeff McCune [Wed, 10 Apr 2013 21:35:42 +0000 (14:35 -0700)]
(maint) Make stdlib usable as a Ruby GEM

Without this patch it is inconvenient to use the functions included in
stdlib in a development setting.  The Puppet modulepath must be
explicitly set for the functions to be automatically loaded.

This patch addresses the problem by adding a gem specification and
dependency Gemfile.  This makes it possible to directly use stdlib and
all of the components it depends upon, like so:

    $ bundle install --path .bundle/gems/
    $ bundle exec puppet apply -e 'notice count([1, 2, 3])'

The first command will install all of the dependencies, including Puppet
and Facter, into the local project directory.  The second command will
make stdlib avaialable as a Gem, which will be picked up by Puppet since
(#7788) was merged into Puppet in the 3.0 release.

12 years ago(maint) Add the behavior for count() with arrays and hashes
Jeff McCune [Wed, 10 Apr 2013 21:33:08 +0000 (14:33 -0700)]
(maint) Add the behavior for count() with arrays and hashes

Without this patch the expected behavior of the count() function when
dealing with an out of bound array index and with a hash key that does
not exist is implicitly encoded in the spec examples.  This is a problem
because the expected behavior is not clear for something similar to the
following example:

    node default {
      $ary = [ 1, 2, 3 ]
      $ary_undef = $ary[100]
      $hsh = { 'one' => 1 }
      $hsh_undef = $hsh['dne']
      $count = count(['hi', $ary_undef, $hsh_undef])
      notice "Count is ${count}"
    }

This patch addresses the problem by making the expected behavior
explicit in the examples.

12 years agoAdd a count function
Erik Dalén [Wed, 10 Apr 2013 12:38:14 +0000 (14:38 +0200)]
Add a count function

Similar to the ruby count method on arrays.

12 years agoMerge branch '4.x'
Adrien Thebo [Mon, 8 Apr 2013 17:06:17 +0000 (10:06 -0700)]
Merge branch '4.x'

12 years agoMerge branch '3.x' into 4.x
Adrien Thebo [Mon, 8 Apr 2013 17:06:08 +0000 (10:06 -0700)]
Merge branch '3.x' into 4.x

12 years agoMerge branch '2.x' into 3.x
Adrien Thebo [Mon, 8 Apr 2013 17:05:29 +0000 (10:05 -0700)]
Merge branch '2.x' into 3.x

This ignores the 2.x .travis.yml when merging up since that version is
only applicable to the 2.x branch.

Conflicts:
.travis.yml

12 years agoMerge branch '2.x-backport_gemfile' into 2.x
Adrien Thebo [Mon, 8 Apr 2013 17:04:43 +0000 (10:04 -0700)]
Merge branch '2.x-backport_gemfile' into 2.x

12 years ago(maint) Backport Gemfile and .travis.yml to 2.x
Adrien Thebo [Mon, 25 Feb 2013 22:00:20 +0000 (14:00 -0800)]
(maint) Backport Gemfile and .travis.yml to 2.x

This is a partial backport and update of 03c5c4a434c2290c021034dbfed82cb0f97e0e87
to add travis-ci support and a Gemfile to 2.x. Right now we're not
testing 2.x in travis-ci and we're experiencing spec failures because we
have to install rspec-puppet from git. The best resolution for this is
to consistently use a Gemfile for running tests.

This commit also rewrites the .travis.yml for 2.x to only test 2.x
versions against ruby 1.8.7 and Puppet < 3.0

Conflicts:
.travis.yml

12 years agoMerge branch 'amosshapira-any2array'
Jeff McCune [Wed, 3 Apr 2013 21:05:52 +0000 (14:05 -0700)]
Merge branch 'amosshapira-any2array'

* amosshapira-any2array:
  Remove resundant code
  (#19998) fix name of function in a comment
  (#19998) Implement any2array

closes #140

12 years agoRemove resundant code
Amos Shapira [Mon, 1 Apr 2013 03:52:07 +0000 (14:52 +1100)]
Remove resundant code

12 years ago(#19998) fix name of function in a comment
Amos Shapira [Sun, 31 Mar 2013 12:47:11 +0000 (23:47 +1100)]
(#19998) fix name of function in a comment

12 years ago(#19998) Implement any2array
Amos Shapira [Sun, 31 Mar 2013 12:37:30 +0000 (23:37 +1100)]
(#19998) Implement any2array

This change is to implement a new function "any2array", which will take any
argument or arguments and create an array which contains it. If the argument
is a single array then it will be returned as-is. If the argument is a single
hash then it will be converted into an array. Otherwise (if there are more than
one argument, or the only argument is not an array or a hash) the function will
return an array containing all the arguments.

12 years agoMerge pull request #139 from hakamadare/19864_num2bool_match_fix
Adrien Thebo [Mon, 1 Apr 2013 16:37:15 +0000 (09:37 -0700)]
Merge pull request #139 from hakamadare/19864_num2bool_match_fix

(19864) num2bool match fix

12 years agoCleanup per adrianthebo suggestions
Steve Huff [Mon, 1 Apr 2013 15:44:09 +0000 (11:44 -0400)]
Cleanup per adrianthebo suggestions

* use Float() to process string arguments
* get rid of doubly nested arrays
* removing needless ternary operator
* improving error message handling

12 years ago(19864) num2bool match fix
Steve Huff [Fri, 29 Mar 2013 19:06:36 +0000 (15:06 -0400)]
(19864) num2bool match fix

This is a bit more heavy-handed than I might like, but it does appear to
do the right things:

* accepts numeric input appropriately, truncating floats
* matches string input against a regex, then coerces number-looking
  strings to int
* makes a best effort to coerce anything else to a string, then subjects
  it to the same treatment
* raises an error in the event of incorrect number of arguments or
  non-number-looking strings

I've also included some additional unit tests.

12 years agoReworked number-handling logic
Steve Huff [Fri, 29 Mar 2013 16:03:33 +0000 (12:03 -0400)]
Reworked number-handling logic

No more coercing to String and regex matching.  Instead, we now coerce
to Integer at the beginning or raise an error if we cannot coerce to
Integer.

A consequence of this change is that the function will now accept
blatantly non-numeric strings as input, and return false.  This seems a
bit goofy to me, but it's how String#to_i works.  If we really don't
like this, then I'm open to suggestions.

12 years agoEnable num2bool to accept numeric input
Steve Huff [Fri, 29 Mar 2013 14:04:05 +0000 (10:04 -0400)]
Enable num2bool to accept numeric input

Also ignore rspec fixtures directory

12 years agoMerge branch '4.x'
Adrien Thebo [Wed, 27 Mar 2013 21:04:19 +0000 (14:04 -0700)]
Merge branch '4.x'

12 years agoMerge branch '3.x' into 4.x
Adrien Thebo [Wed, 27 Mar 2013 21:04:12 +0000 (14:04 -0700)]
Merge branch '3.x' into 4.x

12 years agoMerge branch '2.x' into 3.x
Adrien Thebo [Wed, 27 Mar 2013 21:04:00 +0000 (14:04 -0700)]
Merge branch '2.x' into 3.x

12 years agoMerge branch 'pull-136' into 2.x
Adrien Thebo [Wed, 27 Mar 2013 21:03:40 +0000 (14:03 -0700)]
Merge branch 'pull-136' into 2.x

12 years agoAllow comparisons of Numeric and number as String
Erik Dalén [Wed, 20 Mar 2013 15:36:20 +0000 (16:36 +0100)]
Allow comparisons of Numeric and number as String

Puppet passes numbers as String to functions, but it makes more sense to
compare them as Numeric.
But sometimes Puppet passes them as the wrong type, see:
https://projects.puppetlabs.com/issues/19812

12 years agoMerge branch 'pull-138'
Adrien Thebo [Wed, 27 Mar 2013 20:40:29 +0000 (13:40 -0700)]
Merge branch 'pull-138'

This closes GH-138.

12 years ago(maint) better error reporting for prefix and suffix
Adrien Thebo [Wed, 27 Mar 2013 20:37:25 +0000 (13:37 -0700)]
(maint) better error reporting for prefix and suffix

When prefix and suffix did error checking with positional arguments,
they would not report the position of the argument that failed to
validate. This commit changes the messages to indicate which argument
failed.

12 years agoprefix: fix doc typo Examles -> Examples
Richard Soderberg [Tue, 26 Mar 2013 22:49:09 +0000 (15:49 -0700)]
prefix: fix doc typo Examles -> Examples

12 years agoadd suffix function to accompany the prefix function
Richard Soderberg [Tue, 26 Mar 2013 22:45:40 +0000 (15:45 -0700)]
add suffix function to accompany the prefix function

12 years agoMerge pull request #135 from willaerk/master
Adrien Thebo [Tue, 19 Mar 2013 17:58:55 +0000 (10:58 -0700)]
Merge pull request #135 from willaerk/master

Add floor function implementation and unit tests

12 years agoAdd floor function implementation and unit tests
Kristof Willaert [Tue, 19 Mar 2013 09:00:57 +0000 (10:00 +0100)]
Add floor function implementation and unit tests

12 years agoMerge branch 'pull-59'
Adrien Thebo [Mon, 18 Mar 2013 22:46:41 +0000 (15:46 -0700)]
Merge branch 'pull-59'

This closes GH-59

12 years ago(#13610) Add is_function_available to stdlib
Eric Shamow [Wed, 4 Apr 2012 02:30:46 +0000 (22:30 -0400)]
(#13610) Add is_function_available to stdlib

This function provides a simple wrapper around
Puppet::Parser::Functions.function for access within Puppet manifests.
This will allow users to check whether or not a plugin or functionality
such as hiera is installed on the server.

12 years agoMerge branch '4.x'
Adrien Thebo [Mon, 18 Mar 2013 22:38:14 +0000 (15:38 -0700)]
Merge branch '4.x'

12 years agoMerge branch '3.x' into 4.x
Adrien Thebo [Mon, 18 Mar 2013 22:38:07 +0000 (15:38 -0700)]
Merge branch '3.x' into 4.x

12 years agoMerge branch '2.x' into 3.x
Adrien Thebo [Mon, 18 Mar 2013 22:37:56 +0000 (15:37 -0700)]
Merge branch '2.x' into 3.x

12 years agoMerge branch 'pull-115' into 2.x
Adrien Thebo [Mon, 18 Mar 2013 22:37:46 +0000 (15:37 -0700)]
Merge branch 'pull-115' into 2.x

12 years agostr2bool should return a boolean if called with a boolean
Justin Lambert [Mon, 17 Dec 2012 13:22:36 +0000 (06:22 -0700)]
str2bool should return a boolean if called with a boolean

12 years agoFix number of arguments check in flatten()
Uwe Stuehler [Tue, 23 Oct 2012 14:43:03 +0000 (16:43 +0200)]
Fix number of arguments check in flatten()

The function only uses the first argument, so raise an error with
too few arguments *and* with too many arguments.

12 years agoMerge branch '3.x' into 4.x
Adrien Thebo [Mon, 18 Mar 2013 22:06:33 +0000 (15:06 -0700)]
Merge branch '3.x' into 4.x

12 years agoMerge branch '2.x' into 3.x
Adrien Thebo [Mon, 18 Mar 2013 22:06:07 +0000 (15:06 -0700)]
Merge branch '2.x' into 3.x

12 years agoMerge branch 'pull-98' into 2.x
Adrien Thebo [Mon, 18 Mar 2013 22:05:23 +0000 (15:05 -0700)]
Merge branch 'pull-98' into 2.x

12 years agoFix number of arguments check in flatten()
Uwe Stuehler [Tue, 23 Oct 2012 14:43:03 +0000 (16:43 +0200)]
Fix number of arguments check in flatten()

The function only uses the first argument, so raise an error with
too few arguments *and* with too many arguments.

12 years agoAdd contributing document
Jeff McCune [Mon, 11 Mar 2013 18:06:33 +0000 (11:06 -0700)]
Add contributing document

Copied from the same one included in Puppet and Facter.

[ci skip]

12 years agoMerge pull request #132 from raphink/dev/missing_doc
Adrien Thebo [Mon, 4 Mar 2013 23:25:53 +0000 (15:25 -0800)]
Merge pull request #132 from raphink/dev/missing_doc

Add missing documentation for validate_augeas and validate_cmd to README.markdown

12 years agoAdd missing documentation for validate_augeas and validate_cmd to README.markdown
Raphaël Pinson [Mon, 4 Mar 2013 22:37:57 +0000 (23:37 +0100)]
Add missing documentation for validate_augeas and validate_cmd to README.markdown

12 years agoMerge branch '4.x'
Jeff McCune [Mon, 25 Feb 2013 22:19:13 +0000 (14:19 -0800)]
Merge branch '4.x'

* 4.x:
  (maint) Add Ruby 2.0.0 to Travis build matrix

Conflicts:
.gitignore
.travis.yml
Gemfile

12 years agoMerge branch '3.x' into 4.x
Jeff McCune [Mon, 25 Feb 2013 22:11:18 +0000 (14:11 -0800)]
Merge branch '3.x' into 4.x

* 3.x:
  (maint) Add Ruby 2.0.0 to Travis build matrix

12 years agoMerge branch 'maint/3.x/ruby_two_travis' into 3.x
Jeff McCune [Mon, 25 Feb 2013 22:11:07 +0000 (14:11 -0800)]
Merge branch 'maint/3.x/ruby_two_travis' into 3.x

* maint/3.x/ruby_two_travis:
  (maint) Add Ruby 2.0.0 to Travis build matrix

12 years ago(maint) Add Ruby 2.0.0 to Travis build matrix
Jeff McCune [Mon, 25 Feb 2013 22:00:20 +0000 (14:00 -0800)]
(maint) Add Ruby 2.0.0 to Travis build matrix

Without this patch we're not testing against Ruby 2.0.0 which has recently been
released.  This is a problem because we'd like a way to be notified if a change
set breaks compatibility with future supported versions of Ruby.

This patch should not be taken as an indication that we fully support Ruby 2.0,
just as an indication that we plan to in the future.

This patch also tightens up the specifications of the build matrix.  In
addition to testing against the specific Puppet dependency versions, we're also
testing against the latest 2.7.x release and the latest release.

12 years agoMerge branch '4.x'
Jeff McCune [Mon, 18 Feb 2013 20:22:27 +0000 (12:22 -0800)]
Merge branch '4.x'

* 4.x:
  changed .count to .size to support legacy ruby

closes #131

12 years agoMerge branch '3.x' into 4.x
Jeff McCune [Mon, 18 Feb 2013 20:22:18 +0000 (12:22 -0800)]
Merge branch '3.x' into 4.x

* 3.x:
  changed .count to .size to support legacy ruby

12 years agoMerge branch '2.x' into 3.x
Jeff McCune [Mon, 18 Feb 2013 20:22:04 +0000 (12:22 -0800)]
Merge branch '2.x' into 3.x

* 2.x:
  changed .count to .size to support legacy ruby

12 years agoMerge branch 'mhellmic-2.x' into 2.x
Jeff McCune [Mon, 18 Feb 2013 20:21:49 +0000 (12:21 -0800)]
Merge branch 'mhellmic-2.x' into 2.x

* mhellmic-2.x:
  changed .count to .size to support legacy ruby

12 years agochanged .count to .size to support legacy ruby
Martin Hellmich [Mon, 18 Feb 2013 15:02:15 +0000 (16:02 +0100)]
changed .count to .size to support legacy ruby

12 years agoRevert "Merge pull request #130 from jhoblitt/has_element"
Jeff McCune [Fri, 15 Feb 2013 19:56:16 +0000 (11:56 -0800)]
Revert "Merge pull request #130 from jhoblitt/has_element"

This reverts commit f7a18189ec338b01b0fc89d75def832753af3868, reversing
changes made to 36a7b29630a4d4de17af79b5dd4e9491ec20b123.

I'm reverting this change because of concerns raised by Peter Meier that
it duplicates the "in" operator in the DSL.  The "in" operator is new
information that I did not posses when I made the decision to merge.
Because of this new information I'm un-merging and continuing the
discussion in the comments of
https://projects.puppetlabs.com/issues/19272

Reference: GH-130

12 years agoMerge pull request #130 from jhoblitt/has_element
Jeff McCune [Fri, 15 Feb 2013 06:16:11 +0000 (22:16 -0800)]
Merge pull request #130 from jhoblitt/has_element

(#19272) Add has_element() function

12 years ago(#19272) Add has_element() function
Joshua Hoblitt [Thu, 14 Feb 2013 18:57:35 +0000 (11:57 -0700)]
(#19272) Add has_element() function

It is exceptionally difficult to determine if an array contains an element matching a specific value without an iteration or loop construct.

This function is the Puppet equivalent of Array.includes?(foo) in Ruby.  The implementation is a verbatim copy of has_key() with the minor modifications needed to support arrays instead of hashes.

12 years agoMerge branch 'pull-126'
Adrien Thebo [Tue, 12 Feb 2013 18:20:22 +0000 (10:20 -0800)]
Merge branch 'pull-126'

12 years agoMerge branch 'fatmcgav-feature_19201'
Jeff McCune [Tue, 12 Feb 2013 18:01:04 +0000 (10:01 -0800)]
Merge branch 'fatmcgav-feature_19201'

* fatmcgav-feature_19201:
  (#19201) Add concat function to join two arrays

closes #129

12 years ago(#19201) Add concat function to join two arrays
fatmcgav [Tue, 12 Feb 2013 15:07:18 +0000 (15:07 +0000)]
(#19201) Add concat function to join two arrays

Without this patch applied there is no easy way to append one array to
another.  This is a problem because it is often desirable to join two
arrays without flattening the contents into a single, one dimensional
array.

This patch addresses the problem by adding a `concat()` function which
takes two arguments.  The arguments will be concatenated together and a
new array returned to the caller.

Reviewed-by: Jeff McCune <jeff@puppetlabs.com>
12 years agovalidate_cmd(): Use Puppet::Util::Execution.execute when available
Raphaël Pinson [Thu, 7 Feb 2013 07:56:52 +0000 (08:56 +0100)]
validate_cmd(): Use Puppet::Util::Execution.execute when available

12 years agovalidate_cmd: Use Puppet::Util.execute
Raphaël Pinson [Tue, 5 Feb 2013 08:01:48 +0000 (09:01 +0100)]
validate_cmd: Use Puppet::Util.execute

12 years agoMerge branch 'stephenrjohnson-bug/master/15572_rspec_tests'
Jeff McCune [Wed, 6 Feb 2013 16:14:08 +0000 (08:14 -0800)]
Merge branch 'stephenrjohnson-bug/master/15572_rspec_tests'

* stephenrjohnson-bug/master/15572_rspec_tests:
  ammend .should raise_error to .to raise_error

closes #97

12 years agoammend .should raise_error to .to raise_error
stephen [Tue, 16 Oct 2012 10:54:14 +0000 (11:54 +0100)]
ammend .should raise_error to .to raise_error

13 years agoMerge branch 'raphink-validate_augeas'
Jeff McCune [Wed, 23 Jan 2013 21:30:56 +0000 (13:30 -0800)]
Merge branch 'raphink-validate_augeas'

* raphink-validate_augeas:
  Add an URL to a doc on how to activate augeas in puppet
  validate_augeas: requires augeas
  validate_augeas: Ensure tmpfile is closed and unlinked
  validate_augeas: Ensure augeas handler gets closed
  Add validate_augeas function

closes 114

13 years agoAdd an URL to a doc on how to activate augeas in puppet
Raphaël Pinson [Sun, 20 Jan 2013 12:15:22 +0000 (13:15 +0100)]
Add an URL to a doc on how to activate augeas in puppet

13 years agovalidate_augeas: requires augeas
Raphaël Pinson [Fri, 18 Jan 2013 20:59:47 +0000 (21:59 +0100)]
validate_augeas: requires augeas

13 years agovalidate_augeas: Ensure tmpfile is closed and unlinked
Raphaël Pinson [Fri, 18 Jan 2013 20:54:35 +0000 (21:54 +0100)]
validate_augeas: Ensure tmpfile is closed and unlinked

13 years agovalidate_augeas: Ensure augeas handler gets closed
Raphaël Pinson [Fri, 18 Jan 2013 20:42:54 +0000 (21:42 +0100)]
validate_augeas: Ensure augeas handler gets closed

13 years agoAdd validate_augeas function
Raphaël Pinson [Thu, 6 Dec 2012 10:33:43 +0000 (11:33 +0100)]
Add validate_augeas function

13 years agovalidate_cmd: Make sure tmpfile is always closed and unlinked
Raphaël Pinson [Fri, 18 Jan 2013 20:29:29 +0000 (21:29 +0100)]
validate_cmd: Make sure tmpfile is always closed and unlinked

13 years agoMerge branch 'raphink-validate_cmd'
Jeff McCune [Fri, 18 Jan 2013 17:06:23 +0000 (09:06 -0800)]
Merge branch 'raphink-validate_cmd'

* raphink-validate_cmd:
  Add validate_cmd function

This merge commit closes #113

13 years agoAdd validate_cmd function
Raphaël Pinson [Thu, 6 Dec 2012 10:01:19 +0000 (11:01 +0100)]
Add validate_cmd function

13 years agoMerge branch 'DavidS-master'
Jeff McCune [Tue, 15 Jan 2013 05:50:28 +0000 (21:50 -0800)]
Merge branch 'DavidS-master'

Closes: GH-124
* DavidS-master:
  Add geppetto project definition

13 years agoAdd geppetto project definition
David Schmitt [Mon, 14 Jan 2013 15:05:49 +0000 (16:05 +0100)]
Add geppetto project definition

13 years agoMerge branch 'fix/master/getparam_failure'
Jeff McCune [Tue, 15 Jan 2013 02:41:55 +0000 (18:41 -0800)]
Merge branch 'fix/master/getparam_failure'

* fix/master/getparam_failure:
  (maint) Fix getparam() spec failure on MRI 1.8

13 years ago(maint) Fix getparam() spec failure on MRI 1.8
Jeff McCune [Tue, 15 Jan 2013 02:37:16 +0000 (18:37 -0800)]
(maint) Fix getparam() spec failure on MRI 1.8

Without this patch applied we're getting the following spec failure, but
only in the MRI 1.8 matrix cells.

    Failures:

      1) getparam when compared against a resource with params
         Failure/Error: should run.with_params('User[dan]', '').and_return('')
         ArgumentError:
           interning empty string
         # ./vendor/ruby/1.8/gems/puppet-3.0.2/lib/puppet/parser/resource.rb:42:in `intern'
         # ./vendor/ruby/1.8/gems/puppet-3.0.2/lib/puppet/parser/resource.rb:42:in `[]'
         # ./lib/puppet/parser/functions/getparam.rb:29:in `real_function_getparam'
         # ./vendor/ruby/1.8/gems/puppet-3.0.2/lib/puppet/parser/functions.rb:63:in `send'
         # ./vendor/ruby/1.8/gems/puppet-3.0.2/lib/puppet/parser/functions.rb:63:in `function_getparam'
         # ./vendor/ruby/1.8/gems/rspec-puppet-0.1.5/lib/rspec-puppet/matchers/run.rb:8:in `call'
         # ./vendor/ruby/1.8/gems/rspec-puppet-0.1.5/lib/rspec-puppet/matchers/run.rb:8
         # ./vendor/ruby/1.8/gems/rspec-puppet-0.1.5/lib/rspec-puppet/matchers/run.rb:24:in `call'
         # ./vendor/ruby/1.8/gems/rspec-puppet-0.1.5/lib/rspec-puppet/matchers/run.rb:24
         # ./vendor/ruby/1.8/gems/rspec-expectations-2.11.3/lib/rspec/matchers/extensions/instance_eval_with_args.rb:11:in `instance_exec'
         # ./vendor/ruby/1.8/gems/rspec-expectations-2.11.3/lib/rspec/matchers/extensions/instance_eval_with_args.rb:11:in `instance_eval_with_args'
         # ./vendor/ruby/1.8/gems/rspec-expectations-2.11.3/lib/rspec/matchers/matcher.rb:60:in `matches?'
         # ./vendor/ruby/1.8/gems/rspec-expectations-2.11.3/lib/rspec/expectations/handler.rb:9:in `handle_matcher'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/subject.rb:64:in `should'
         # ./spec/functions/getparam_spec.rb:29
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in `instance_eval'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in `with_around_each_hooks'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in `run_examples'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `map'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in `run_examples'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `map'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `map'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in `report'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
         # ./vendor/ruby/1.8/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `autorun'
         # ./vendor/ruby/1.8/bin/rspec:23

This patch addresses the problem by explicitly returning an empty string if the
string itself is empty.  This avoids trying to convert an empty string to a
symbol which is the root cause of the problem.

13 years agoIgnore bundler turds
Jeff McCune [Thu, 10 Jan 2013 02:02:34 +0000 (18:02 -0800)]
Ignore bundler turds

13 years agoMerge branch 'offlinehacker-feature/master/getparam_function'
Jeff McCune [Thu, 10 Jan 2013 01:52:41 +0000 (17:52 -0800)]
Merge branch 'offlinehacker-feature/master/getparam_function'

* offlinehacker-feature/master/getparam_function:
  Add getparam function to get defined resource parameters

13 years agoAdd getparam function to get defined resource parameters
Jaka Hudoklin [Wed, 2 Jan 2013 12:10:43 +0000 (12:10 +0000)]
Add getparam function to get defined resource parameters

As far as i know there's no other puppet-dsl-like way to get parameter of
defined resource, so that's why i implemented getparam function, which takes
resource reference and parameter name and returns parameter value.

    Here's another example why this function is really useful:

    define config($path, $config_param1, $config_param2) { }

    define example_resource($config) {
        $path = getparam($config, "path")

        notice("Path is $path")
    }

    define example_resource2($example_resource, $config = getparam($example_resource, "config")) {
        $config_param1 = getparam($config, "config_param1")

        notice("Config parameter is $config_param1")
    }

    define example_resource3($example_resource, $config = getparam($example_resource, "config")) {
        $config_param2 = getparam($config, "config_param2")

        notice("Config parameter is $config_param2")
    }

    class test_getparam {

        config { "config_instance":
            path => "/some/config/path",
            config_param1 => "someconfigtext1",
            config_param2 => "someconfigtext2",
        }

        example_resource { "example_resource_instance":
            config => Config["config_instance"]
        }

        example_resource2 { "example_resource_instance":
            example_resource => Example_resource["example_resource_instance"]
        }

        example_resource3 { "example_resource_instance":
            example_resource => Example_resource2["example_resource_instance"]
        }
    }

    class { "test_getparam": }

13 years agoMerge pull request #123 from jeffmccune/feature/master/travis_webhook
Jeff McCune [Thu, 10 Jan 2013 00:12:47 +0000 (16:12 -0800)]
Merge pull request #123 from jeffmccune/feature/master/travis_webhook

Tell Travis CI to notify the PDC WebHook

13 years ago(maint) Update puppet version in Travis configuration
Jeff McCune [Mon, 7 Jan 2013 22:48:30 +0000 (14:48 -0800)]
(maint) Update puppet version in Travis configuration

Without this patch we'll test against all Puppet 3.0 versions, but not
4.  This is a problem because the travis configuration should be
relatively future proof to minimize surprises.

This patch addresses the problem by using >= instead of ~> in the
dependency specification.  The patch also combines two different
notification sections into a single entry.

13 years agoTell Travis CI to notify the PDC WebHook
Jeff McCune [Mon, 7 Jan 2013 02:45:43 +0000 (18:45 -0800)]
Tell Travis CI to notify the PDC WebHook

Without this patch the so-called "puppet development community" hook
service isn't being notified when Travis CI accepts jobs.  This is a
problem because we want the ability for Travis Bot to comment on pull
requests as a result of CI build results.  For example, if the build
fails, then Gepetto Bot could make some helpful suggestions on how to
re-run the build by amending a commit and force-pushing the branch.

This patch uses the notifications section of the travis.yml
configuration file, as documented at:
http://about.travis-ci.org/docs/user/notifications/#Webhook-notification

13 years agoMerge pull request #122 from jeffmccune/fix/master/travis
Jeff McCune [Mon, 7 Jan 2013 18:19:21 +0000 (10:19 -0800)]
Merge pull request #122 from jeffmccune/fix/master/travis

Fix typo in travis configuration

13 years agoFix typo in travis configuration
Jeff McCune [Sun, 6 Jan 2013 05:11:53 +0000 (21:11 -0800)]
Fix typo in travis configuration

The exclude keyword was accidentally specified twice.

13 years agoMerge pull request #121 from jeffmccune/fix/master/travis
Jeff McCune [Sun, 6 Jan 2013 05:31:53 +0000 (21:31 -0800)]
Merge pull request #121 from jeffmccune/fix/master/travis

Future proof travis build matrix

13 years agoFuture proof travis build matrix
Jeff McCune [Sun, 6 Jan 2013 05:11:53 +0000 (21:11 -0800)]
Future proof travis build matrix

Without this patch we're not building against ruby head.  This is a
problem because we need to know if standard lib works with the latest
version of MRI.

This patch builds against ruby head but also allows the build to pass if
there are failures with ruby-head.

13 years agoMerge branch 'feature/master/travis_ci'
Jeff McCune [Sat, 5 Jan 2013 23:37:15 +0000 (15:37 -0800)]
Merge branch 'feature/master/travis_ci'

* feature/master/travis_ci:
  (maint) Add Travis CI Support

13 years ago(maint) Add Travis CI Support
Jeff McCune [Sat, 5 Jan 2013 23:01:56 +0000 (15:01 -0800)]
(maint) Add Travis CI Support

Without this patch stdlib has Travis CI configuration files, but they
don't seem to completely specify the dependency versions and the build
matrix.  This patch addresses the problem by putting the dependency
information in the conventional Gemfile location.

This patch should coincide with enabling Travis CI support for pull
requests.  A build status image is also included in the project README.

13 years agoMerge branch '4.x'
Jeff McCune [Thu, 3 Jan 2013 21:39:42 +0000 (13:39 -0800)]
Merge branch '4.x'

* 4.x:
  Add test/validation for is_float if created from an arithmetical operation
  Add test/validation for is_integer if created from an arithmetical operation
  Add test/validation for is_numeric if created from an arithmetical operation

13 years agoMerge branch '3.x' into 4.x
Jeff McCune [Thu, 3 Jan 2013 21:39:05 +0000 (13:39 -0800)]
Merge branch '3.x' into 4.x

* 3.x:
  Add test/validation for is_float if created from an arithmetical operation
  Add test/validation for is_integer if created from an arithmetical operation
  Add test/validation for is_numeric if created from an arithmetical operation

13 years agoMerge branch '3.2.x' into 3.x
Jeff McCune [Thu, 3 Jan 2013 21:38:36 +0000 (13:38 -0800)]
Merge branch '3.2.x' into 3.x

* 3.2.x:
  Add test/validation for is_float if created from an arithmetical operation
  Add test/validation for is_integer if created from an arithmetical operation
  Add test/validation for is_numeric if created from an arithmetical operation

13 years agoMerge branch 'stephenrjohnson-bug/3.x/18157_arithmetical_operations' into 3.2.x
Jeff McCune [Thu, 3 Jan 2013 21:38:16 +0000 (13:38 -0800)]
Merge branch 'stephenrjohnson-bug/3.x/18157_arithmetical_operations' into 3.2.x

* stephenrjohnson-bug/3.x/18157_arithmetical_operations:
  Add test/validation for is_float if created from an arithmetical operation
  Add test/validation for is_integer if created from an arithmetical operation
  Add test/validation for is_numeric if created from an arithmetical operation

13 years agoAdd test/validation for is_float if created from an arithmetical operation
stephen [Thu, 3 Jan 2013 14:05:29 +0000 (14:05 +0000)]
Add test/validation for is_float if created from an arithmetical operation

13 years agoAdd test/validation for is_integer if created from an arithmetical operation
stephen [Thu, 3 Jan 2013 14:02:58 +0000 (14:02 +0000)]
Add test/validation for is_integer if created from an arithmetical operation

13 years agoAdd test/validation for is_numeric if created from an arithmetical operation
stephen [Thu, 3 Jan 2013 13:53:03 +0000 (13:53 +0000)]
Add test/validation for is_numeric if created from an arithmetical operation

13 years agoMerge branch 'maint/master/update_readme'
Jeff McCune [Tue, 4 Dec 2012 23:09:35 +0000 (15:09 -0800)]
Merge branch 'maint/master/update_readme'

* maint/master/update_readme:
  Clarify that stdlib 3 supports Puppet 3

13 years agoClarify that stdlib 3 supports Puppet 3
Jeff McCune [Tue, 4 Dec 2012 23:07:46 +0000 (15:07 -0800)]
Clarify that stdlib 3 supports Puppet 3

Minor clarification to the compatibility section of the README.

13 years agoMerge branch 'dalen-style_fixes'
Jeff McCune [Fri, 30 Nov 2012 16:19:34 +0000 (08:19 -0800)]
Merge branch 'dalen-style_fixes'

* dalen-style_fixes:
  maint: style guideline fixes

13 years agomaint: style guideline fixes
Erik Dalén [Fri, 30 Nov 2012 10:02:02 +0000 (11:02 +0100)]
maint: style guideline fixes

13 years agoMerge branch '4.x'
Jeff McCune [Wed, 28 Nov 2012 22:45:26 +0000 (14:45 -0800)]
Merge branch '4.x'

* 4.x:
  Update Modulefile, CHANGELOG for 3.2.0