X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fprivate.rb;h=11a9451f99322070bfa131a3338d9a9b6f91e029;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=3b00ba12f1c4b685ccc7e8165e3f62a3cc212e28;hpb=ad88f67c13ae0f1a08936dad643f1e3509ab5f40;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/private.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/private.rb index 3b00ba12f..11a9451f9 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/private.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/private.rb @@ -1,17 +1,20 @@ # # private.rb # - module Puppet::Parser::Functions - newfunction(:private, :doc => <<-'EOS' - DEPRECATED: Sets the current class or definition as private. + newfunction(:private, :doc => <<-'DOC' + @summary + **Deprecated:** Sets the current class or definition as private. Calling the class or definition from outside the current module will fail. - EOS - ) do |args| - warning("private() DEPRECATED: This function will cease to function on Puppet 4; please use assert_private() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.") - if !Puppet::Parser::Functions.autoloader.loaded?(:assert_private) + + @return + Sets the current class or definition as private + DOC + ) do |args| + warning("private() DEPRECATED: This function will cease to function on Puppet 4; please use assert_private() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.") # rubocop:disable Metrics/LineLength : Cannot shorten this line + unless Puppet::Parser::Functions.autoloader.loaded?(:assert_private) Puppet::Parser::Functions.autoloader.load(:assert_private) end - function_assert_private([(args[0] unless args.size < 1)]) + function_assert_private([(args[0] unless args.empty?)]) end end