1
0
Fork 0
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:
John Mair 2011-05-08 18:21:15 +12:00
parent d4eff58d87
commit 69ebdde4c1

View file

@ -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