Closed grstearns closed 1 year ago
Thanks seems to work great for the Class#method
case :) But it doesn't appear to work for just Class
syntax. But perhaps this doesn't matter so much, thanks for your code :))
nonetheless i've enclosed my code showing the problem, your branch is checked out below:
[7] (pry) #<V>: 0> show-stack
Showing all accessible frames in stack (9 in total):
--
=> #0 [method] zeta <Object#zeta()>
#1 [method] gamma <V#gamma()>
#2 [method] beta <V#beta()>
#3 [method] c <Object#c()>
#4 [block] block in b <Object#b()>
#5 [method] b <Object#b()>
#6 [method] alphabet <J#alphabet(y)>
#7 [eval] <main>
#8 [top] <main>
[8] (pry) #<V>: 0> up J
Error: No frame that matches J found!
[9] (pry) #<V>: 0> up J#alphabet
Frame number: 6/8
Frame type: method
From: /Users/john/ruby/projects/pry-stack_explorer/examples/example3.rb @ line 39 J#alphabet:
39: def alphabet(y)
40: x = 20
=> 41: b
42: end
[10] (pry) #<J>: 0>
Got it.
@grstearns ah thanks! I already pushed a gem with your previous changes (0.4.5) i'll look at your new changes and probably apply them later tonight, cool!
Hi, is this still current? (#3)
Quoting #3:
e.g up Hello #=> first frame that has Hello method OR (more likely) first frame that's instance of Hello class e.g up Hello#method #=> first frame that is an invocation of Hello#method
should still work based on regex can regex on class name e.g up Hel or on method name e.g up Hello#met or both, e.g: up Hel#met should attempt Hello as method first, if fail, then try as class
We added the feature @banister requested to use more specific syntax to jump stack frames.
This included a minor refactor of find_frame_by_regex in commands to avoid code duplication.