[go: up one dir, main page]

Add support for pry 0.13

I've taken a quick look at pry 0.13 before releasing version 1.2.2, and it looks like break is broken (👀), and there's a deprecation warning as well.

Example code:

require 'pry'

def some_method
  binding.pry          # Execution will stop here.
  Hello.new.potato
  puts 'Hello, World!' # Run 'step' or 'next' in the console to move here.
end

class Hello
  def potato
    puts "potato1"
    puts "potato2"
  end
end

some_method

and here's an interaction that shows both the warning and the issue:

$ be ruby test.rb 

From: /home/knuckles/ruby/pry-debugger-jruby/test.rb:4 Object#some_method:

    3: def some_method
 => 4:   binding.pry          # Execution will stop here.
    5:   Hello.new.potato
    6:   puts 'Hello, World!' # Run 'step' or 'next' in the console to move here.
    7: end

[1] pry(main)> break Hello#potato
/home/knuckles/ruby/pry-debugger-jruby/lib/pry-debugger-jruby/commands.rb:121: warning: _pry_ is deprecated, use pry_instance instead
NameError: undefined local variable or method `text' for #<#<Class:0x77324a58>:0x2c7c0e36>
Did you mean?  test
from /home/knuckles/ruby/pry-debugger-jruby/lib/pry-debugger-jruby/commands.rb:239:in `print_full_breakpoint'
[1] pry(main)> break Hello#potato
/home/knuckles/ruby/pry-debugger-jruby/lib/pry-debugger-jruby/commands.rb:121: warning: _pry_ is deprecated, use pry_instance instead
NameError: undefined local variable or method `text' for #<#<Class:0x77324a58>:0x11eec06b>
Did you mean?  test
from /home/knuckles/ruby/pry-debugger-jruby/lib/pry-debugger-jruby/commands.rb:239:in `print_full_breakpoint'
``