mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
added support for 'cd ::' which enters TOPLEVEL_BINDING scope
This commit is contained in:
parent
d4eff58d87
commit
69ebdde4c1
1 changed files with 10 additions and 8 deletions
|
@ -7,19 +7,21 @@ class Pry
|
|||
import Ls
|
||||
|
||||
command "cd", "Start a Pry session on VAR (use `cd ..` to go back and `cd /` to return to Pry top-level)", :keep_retval => true do |obj|
|
||||
if !obj
|
||||
case obj
|
||||
when nil
|
||||
output.puts "Must provide an object."
|
||||
next
|
||||
end
|
||||
|
||||
throw(:breakout, opts[:nesting].level) if obj == ".."
|
||||
|
||||
if obj == "/"
|
||||
when ".."
|
||||
throw(:breakout, opts[:nesting].level)
|
||||
when "/"
|
||||
throw(:breakout, 1) if opts[:nesting].level > 0
|
||||
next
|
||||
when "::"
|
||||
TOPLEVEL_BINDING.pry
|
||||
next
|
||||
else
|
||||
Pry.start target.eval(opts[:arg_string])
|
||||
end
|
||||
|
||||
Pry.start target.eval(opts[:arg_string])
|
||||
end
|
||||
|
||||
command "nesting", "Show nesting information." do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue