X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Ffloor.rb;h=df132fc389fd3b889024954347593a2f2050b3c0;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=9e4b5044b24245f538099f07f0d104831f71dab8;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/floor.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/floor.rb index 9e4b5044b..df132fc38 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/floor.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/floor.rb @@ -1,15 +1,21 @@ +# +# floor.rb +# module Puppet::Parser::Functions - newfunction(:floor, :type => :rvalue, :doc => <<-EOS + newfunction(:floor, :type => :rvalue, :doc => <<-DOC Returns the largest integer less or equal to the argument. Takes a single numeric value as an argument. - EOS - ) do |arguments| + + Note: from Puppet 6.0.0, the compatible function with the same name in Puppet core + will be used instead of this function. + DOC + ) do |arguments| raise(Puppet::ParseError, "floor(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1 begin arg = Float(arguments[0]) - rescue TypeError, ArgumentError => e + rescue TypeError, ArgumentError => _e raise(Puppet::ParseError, "floor(): Wrong argument type given (#{arguments[0]} for Numeric)") end