X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fis_array.rb;h=1df57b2fa5ade7c23bf95bacb3b187347b3a8eb1;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=b39e184ae5411c3813a9d2d2fd089d85b18e9c7a;hpb=ad88f67c13ae0f1a08936dad643f1e3509ab5f40;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/is_array.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/is_array.rb index b39e184ae..1df57b2fa 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/is_array.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/is_array.rb @@ -1,15 +1,23 @@ # # is_array.rb # - module Puppet::Parser::Functions - newfunction(:is_array, :type => :rvalue, :doc => <<-EOS -Returns true if the variable passed to this function is an array. - EOS - ) do |arguments| + newfunction(:is_array, :type => :rvalue, :doc => <<-DOC + @summary + **Deprecated:** Returns true if the variable passed to this function is an array. + + @return [Boolean] + Returns `true` or `false` + + > **Note:* **Deprecated** Will be removed in a future version of stdlib. See + [`validate_legacy`](#validate_legacy). + DOC + ) do |arguments| - raise(Puppet::ParseError, "is_array(): Wrong number of arguments " + - "given (#{arguments.size} for 1)") if arguments.size < 1 + function_deprecation([:is_array, 'This method is deprecated, please use the stdlib validate_legacy function, + with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README.']) + + raise(Puppet::ParseError, "is_array(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty? type = arguments[0] @@ -18,5 +26,3 @@ Returns true if the variable passed to this function is an array. return result end end - -# vim: set ts=2 sw=2 et :