Server IP : 213.32.127.20 / Your IP : 216.73.216.252 Web Server : Apache System : Linux ns3.servidorneptuno.com 4.18.0-553.16.1.lve.el8.x86_64 #1 SMP Tue Aug 13 17:45:03 UTC 2024 x86_64 User : atoqsfjh ( 1072) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.8/rubygems/core_ext/ |
Upload File : |
# frozen_string_literal: true # `uplevel` keyword argument of Kernel#warn is available since ruby 2.5. if RUBY_VERSION >= "2.5" module Kernel path = "#{__dir__}/" # Frames to be skipped start with this path. original_warn = method(:warn) remove_method :warn class << self remove_method :warn end module_function define_method(:warn) {|*messages, **kw| unless uplevel = kw[:uplevel] if Gem.java_platform? return original_warn.call(*messages) else return original_warn.call(*messages, **kw) end end # Ensure `uplevel` fits a `long` uplevel, = [uplevel].pack("l!").unpack("l!") if uplevel >= 0 start = 0 while uplevel >= 0 loc, = caller_locations(start, 1) unless loc # No more backtrace start += uplevel break end start += 1 unless loc.path.start_with?(path) # Non-rubygems frames uplevel -= 1 end end uplevel = start end kw[:uplevel] = uplevel original_warn.call(*messages, **kw) } end end