Doesn't seem to work on the first statement
skull-squadron opened this issue · 4 comments
skull-squadron commented
- pry 0.10.3
- pry-inline 1.0.0
Tested combinations
- pry-nav 0.2.4 + JRuby 9.0.4.0
- pry-byebug 3.3.0 + Ruby (MRI) 2.2.5
I'm sure it's something simple/obvious/PEBKAC, please feel free ping me with "@steakknife ..." if more debugging is needed.
skull-squadron commented
1] pry(main)> def foo(x)
[1] pry(main)* x += 9
[1] pry(main)* puts "hi"
[1] pry(main)* x *= 3
[1] pry(main)* x
[1] pry(main)* end
=> :foo
[2] pry(main)>
[3] pry(main)> def main
[3] pry(main)* binding.pry
[3] pry(main)* foo(3)
[3] pry(main)* end
=> :main
[4] pry(main)> main
From: (pry) @ line 9 Object#main:
7: def main
8: binding.pry
=> 9: foo(3)
10: end
[1] pry(main)> step
From: (pry) @ line 2 Object#foo:
1: def foo(x)
=> 2: x += 9
3: puts "hi"
4: x *= 3
5: x
6: end
[1] pry(main)> step
From: (pry) @ line 3 Object#foo:
1: def foo(x)
2: x += 9
=> 3: puts "hi"
4: x *= 3
5: x
6: end
[1] pry(main)>
skull-squadron commented
Ahh... there's no output on the first statement. But the first statement mutates a value in the current scope, so it should still print something, yeah?
seikichi commented
Thanks @steakknife
I reporoduced the problem.
I agree that the first statement x += 9
should print something like bellow:
[1] pry(main)> step
From: (pry) @ line 3 Object#foo:
1: def foo(x)
2: x += 9 # x: 12
=> 3: puts "hi"
4: x *= 3
5: x
6: end
I'll fix the problem, please wait.
seikichi commented
I fixed the problem and release v1.0.1
. Thanks @steakknife
[1] pry(main)> def foo(x)
[1] pry(main)* x += 9
[1] pry(main)* puts 'hi'
[1] pry(main)* x *= 3
[1] pry(main)* x
[1] pry(main)* end
=> :foo
[2] pry(main)> def main
[2] pry(main)* binding.pry
[2] pry(main)* foo(3)
[2] pry(main)* end
=> :main
[3] pry(main)> main
From: (pry) @ line 9 Object#main:
7: def main
8: binding.pry
=> 9: foo(3)
10: end
[1] pry(main)> s
From: (pry) @ line 2 Object#foo:
1: def foo(x) # x: 3
=> 2: x += 9
3: puts 'hi'
4: x *= 3
5: x
6: end
[1] pry(main)> n
From: (pry) @ line 3 Object#foo:
1: def foo(x)
2: x += 9 # x: 12
=> 3: puts 'hi'
4: x *= 3
5: x
6: end
[1] pry(main)> n
hi
From: (pry) @ line 4 Object#foo:
1: def foo(x)
2: x += 9 # x: 12
3: puts 'hi'
=> 4: x *= 3
5: x
6: end
[1] pry(main)> n
From: (pry) @ line 5 Object#foo:
1: def foo(x)
2: x += 9
3: puts 'hi'
4: x *= 3 # x: 36
=> 5: x
6: end