blob: c65279f74c991b8b13d94093b6a565badc3c3ba4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# frozen_string_literal: true
class Pry
# @api private
# @since v0.13.0
module Warning
# Prints a warning message with exact file and line location, similar to how
# Ruby's -W prints warnings.
#
# @param [String] message
# @return [void]
def self.warn(message)
location = caller_locations(2..2).first
path = location.path
lineno = location.lineno
Kernel.warn("#{path}:#{lineno}: warning: #{message}")
end
end
end
|