X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fvalidate_bool.rb;h=d6f07af00cee6a82753a4de87beb65c4d67beff0;hp=d3bf3d021afa083bac5a23821ebd653db4e85fad;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb index d3bf3d021..d6f07af00 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb @@ -2,25 +2,30 @@ # validate_bool.rb # module Puppet::Parser::Functions - newfunction(:validate_bool, :doc => <<-'DOC') do |args| - Validate that all passed values are either true or false. Abort catalog - compilation if any value fails this check. + newfunction(:validate_bool, :doc => <<-DOC + @summary + Validate that all passed values are either true or false. Abort catalog + compilation if any value fails this check. - The following values will pass: + @return + validate boolean - $iamtrue = true - validate_bool(true) - validate_bool(true, true, false, $iamtrue) + @example **Usage** - The following values will fail, causing compilation to abort: + The following values will pass: - $some_array = [ true ] - validate_bool("false") - validate_bool("true") - validate_bool($some_array) + $iamtrue = true + validate_bool(true) + validate_bool(true, true, false, $iamtrue) - DOC + The following values will fail, causing compilation to abort: + $some_array = [ true ] + validate_bool("false") + validate_bool("true") + validate_bool($some_array) + DOC + ) do |args| if args.empty? raise Puppet::ParseError, "validate_bool(): wrong number of arguments (#{args.length}; must be > 0)" end