ruby - How can I detect how many levels down Pry has gone -


if i'm @ bash prompt , type bash can detect i'm @ 2nd level typing echo $shlvl.

suppose i'm in pry session , type pry again. how can detect i'm @ 2nd level down? how can detect pry level? nothing listed in (pry.methods - object.methods).sort seems have useful.

this testing code pry-related project, need detect level.

if call caller within pry session within pry session, see list of commands. among them, should able find part corresponds nested pry call. find crucial line related each pry session call, , know level. far checked, should find 2 occurrences of line like:

 "/usr/local/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:67:in `repl'" 

count such lines.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -