module Pry::Warning

@api private @since v0.13.0

Public Class Methods

warn(message) click to toggle source

Prints a warning message with exact file and line location, similar to how Ruby’s -W prints warnings.

@param [String] message @return [void]

# File lib/pry/warning.rb, line 12
def self.warn(message)
  location = caller_locations(2..2).first
  path = location.path
  lineno = location.lineno

  Kernel.warn("#{path}:#{lineno}: warning: #{message}")
end