X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fdeprecation.rb;h=2a39cc379df3e65f0d1c0c643f6e44890ccba83d;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=39d306a0a6bb084039966365ec325ba19c534e8b;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/deprecation.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/deprecation.rb index 39d306a0a..2a39cc379 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/deprecation.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/deprecation.rb @@ -1,15 +1,25 @@ +# +# deprecation.rb +# module Puppet::Parser::Functions - newfunction(:deprecation, :doc => <<-EOS - Function to print deprecation warnings (this is the 3.X version of it), The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method.). -EOS - ) do |arguments| + newfunction(:deprecation, :doc => <<-DOC + @summary + Function to print deprecation warnings (this is the 3.X version of it). + + The uniqueness key - can appear once. The msg is the message text including any positional + information that is formatted by the user/caller of the method.). + + @return [String] + return deprecation warnings +DOC + ) do |arguments| raise(Puppet::ParseError, "deprecation: Wrong number of arguments given (#{arguments.size} for 2)") unless arguments.size == 2 key = arguments[0] message = arguments[1] - if ENV['STDLIB_LOG_DEPRECATIONS'] == "true" + if ENV['STDLIB_LOG_DEPRECATIONS'] == 'true' warning("deprecation. #{key}. #{message}") end end