diff options
author | André Luis Leal Cardoso Junior <andrehjr@gmail.com> | 2022-03-09 19:01:20 -0300 |
---|---|---|
committer | André Luis Leal Cardoso Junior <andrehjr@gmail.com> | 2022-03-10 00:01:28 -0300 |
commit | e43dbb0962eb065e8e8be59fcacd1068bd62519e (patch) | |
tree | 986660971b84d530fc4be4d6bd80335d16a467d2 /lib | |
parent | db5b2b4ef67f45cc37357585920c48898a97be1c (diff) | |
download | pry-e43dbb0962eb065e8e8be59fcacd1068bd62519e.tar.gz |
Remove support for Ruby 1.9.3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pry/warning.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/pry/warning.rb b/lib/pry/warning.rb index 14c119ed..c65279f7 100644 --- a/lib/pry/warning.rb +++ b/lib/pry/warning.rb @@ -10,16 +10,9 @@ class Pry # @param [String] message # @return [void] def self.warn(message) - if Kernel.respond_to?(:caller_locations) - location = caller_locations(2..2).first - path = location.path - lineno = location.lineno - else - # Ruby 1.9.3 support. - frame = caller[1].split(':') # rubocop:disable Performance/Caller - path = frame.first - lineno = frame[1] - end + location = caller_locations(2..2).first + path = location.path + lineno = location.lineno Kernel.warn("#{path}:#{lineno}: warning: #{message}") end |