diff options
author | Conrad Irwin <conrad.irwin@gmail.com> | 2012-11-20 13:44:23 -0800 |
---|---|---|
committer | Conrad Irwin <conrad.irwin@gmail.com> | 2012-11-20 13:44:23 -0800 |
commit | 5a240b2d0c7ecb4a315ab8eeb96b1e6531af94dc (patch) | |
tree | 4bd06d8761b0cc8d4e1ac7e5309742b02604d24f | |
parent | 07137ee5e5adc84590645a7dbed66b6ab2123c55 (diff) | |
download | pry-5a240b2d0c7ecb4a315ab8eeb96b1e6531af94dc.tar.gz |
Revert "make whereami more consistent [Fixes #383]"
This reverts commit 2e8881f59e2a9b2879194490bcd93cde4926fc22.
-rw-r--r-- | lib/pry/commands/whereami.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/pry/commands/whereami.rb b/lib/pry/commands/whereami.rb index 655209ad..121e642b 100644 --- a/lib/pry/commands/whereami.rb +++ b/lib/pry/commands/whereami.rb @@ -22,16 +22,8 @@ class Pry def setup @method = Pry::Method.from_binding(target) - if internal_binding?(target) - location = _pry_.backtrace.detect do |x| - !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 + @file = target.eval('__FILE__') + @line = target.eval('__LINE__') end def options(opt) @@ -54,10 +46,12 @@ class Pry if opts.quiet? && (internal_binding?(target) || !code?) return elsif internal_binding?(target) - if @file.end_with?("bin/pry") + if target_self == TOPLEVEL_BINDING.eval("self") output.puts "At the top level." - return + else + output.puts "Inside #{Pry.view_clip(target_self)}." end + return end set_file_and_dir_locals(@file) |