mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Revert "make whereami more consistent [Fixes #383]"
This reverts commit 2e8881f59e
.
This commit is contained in:
parent
07137ee5e5
commit
5a240b2d0c
1 changed files with 6 additions and 12 deletions
|
@ -22,16 +22,8 @@ class Pry
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@method = Pry::Method.from_binding(target)
|
@method = Pry::Method.from_binding(target)
|
||||||
if internal_binding?(target)
|
@file = target.eval('__FILE__')
|
||||||
location = _pry_.backtrace.detect do |x|
|
@line = target.eval('__LINE__')
|
||||||
!x.start_with?(File.expand_path('../../../../lib', __FILE__))
|
|
||||||
end
|
|
||||||
@file = location.split(":").first
|
|
||||||
@line = location.split(":")[1].to_i
|
|
||||||
else
|
|
||||||
@file = target.eval('__FILE__')
|
|
||||||
@line = target.eval('__LINE__')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def options(opt)
|
def options(opt)
|
||||||
|
@ -54,10 +46,12 @@ class Pry
|
||||||
if opts.quiet? && (internal_binding?(target) || !code?)
|
if opts.quiet? && (internal_binding?(target) || !code?)
|
||||||
return
|
return
|
||||||
elsif internal_binding?(target)
|
elsif internal_binding?(target)
|
||||||
if @file.end_with?("bin/pry")
|
if target_self == TOPLEVEL_BINDING.eval("self")
|
||||||
output.puts "At the top level."
|
output.puts "At the top level."
|
||||||
return
|
else
|
||||||
|
output.puts "Inside #{Pry.view_clip(target_self)}."
|
||||||
end
|
end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
set_file_and_dir_locals(@file)
|
set_file_and_dir_locals(@file)
|
||||||
|
|
Loading…
Reference in a new issue