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_string.rb;h=f6c52a7111585135216e194083988ae1184411f3;hp=c2847b648f4f335800437cd5c8d4051c236db939;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_string.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_string.rb index c2847b648..f6c52a711 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_string.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_string.rb @@ -2,29 +2,34 @@ # validate_String.rb # module Puppet::Parser::Functions - newfunction(:validate_string, :doc => <<-'DOC') do |args| - Validate that all passed values are string data structures. Abort catalog - compilation if any value fails this check. + newfunction(:validate_string, :doc => <<-DOC + @summary + Validate that all passed values are string data structures - The following values will pass: + @return + Validate that all passed values are string data structures. Failed + compilation if any value fails this check. - $my_string = "one two" - validate_string($my_string, 'three') + @example **Usage** + The following values will pass: - The following values will fail, causing compilation to abort: + $my_string = "one two" + validate_string($my_string, 'three') - validate_string(true) - validate_string([ 'some', 'array' ]) + The following values will fail, causing compilation to abort: - Note: validate_string(undef) will not fail in this version of the + validate_string(true) + validate_string([ 'some', 'array' ]) + > *Note:* + Validate_string(undef) will not fail in this version of the functions API (incl. current and future parser). Instead, use: - - if $var == undef { - fail('...') + ``` + if $var == undef { + fail('...') } - + ``` DOC - + ) do |args| function_deprecation([:validate_string, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README.'])