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_slength.rb;h=c28650fcdc40f032a77646db8b5cf59d7bbabcdd;hp=db5010e2aaca47c84dd2c8a50f669f309908cf9a;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb index db5010e2a..c28650fcd 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb @@ -2,27 +2,29 @@ # validate_slength.rb # module Puppet::Parser::Functions - newfunction(:validate_slength, :doc => <<-'DOC') do |args| - Validate that the first argument is a string (or an array of strings), and - less/equal to than the length of the second argument. An optional third - parameter can be given the minimum length. It fails if the first - argument is not a string or array of strings, and if arg 2 and arg 3 are - not convertable to a number. + newfunction(:validate_slength, :doc => <<-DOC + @summary + Validate that the first argument is a string (or an array of strings), and less/equal to than the length of the second argument. + An optional third parameter can be given the minimum length. It fails if the first argument is not a string or array of strings, + and if arg 2 and arg 3 are not convertable to a number. - The following values will pass: + @return + validate that the first argument is a string (or an array of strings), and less/equal to than the length of the second argument. Fail compilation if any of the checks fail. - validate_slength("discombobulate",17) - validate_slength(["discombobulate","moo"],17) - validate_slength(["discombobulate","moo"],17,3) + @example **Usage** + The following values will pass: - The following valueis will not: + validate_slength("discombobulate",17) + validate_slength(["discombobulate","moo"],17) + validate_slength(["discombobulate","moo"],17,3) - validate_slength("discombobulate",1) - validate_slength(["discombobulate","thermometer"],5) - validate_slength(["discombobulate","moo"],17,10) + The following valueis will not: + validate_slength("discombobulate",1) + validate_slength(["discombobulate","thermometer"],5) + validate_slength(["discombobulate","moo"],17,10) DOC - + ) do |args| function_deprecation([:validate_slength, 'This method is deprecated, please use the stdlib validate_legacy function, with String[]. There is further documentation for validate_legacy function in the README.'])