pry-byebug
pry-byebug copied to clipboard
Enable pry-like stop on binding.pry
Given the discussion in Issue #45, this adds a configuration option to enable pry-like behavior on binding.pry.
I don't think this is either better or worse, exactly, but the "step 3" behavior does seem to break some popular pry plugins (like pry-rescue.)
I did some non-exhaustive poking around and it appears to fix that issue as well. It definitely fixes the described issue in #45 where the last line of the file can now be binding.pry
I've left the default behavior as :byebug - so people who want the :pry behavior can set it in their .pryrc files.
The CI Fail is because of RuboCop - but it's not giving me any information - just "Hook raised unexpected error."
Great analysis but unforunately, :cry: this doesn't work on my machine. It's critical to do the gem install before the test because uninstalling pry-byebug actually fixes the original reported issue.
Running ruby test/examples/last_line.rb didn't invoke pry. If you uninstall byebug, it will invoke.
I tried adding this to my .pryrc too.
PryByebug.binding_behavior = :pry
Poop. Looks like .pryrc isn't loaded until the actual Pry repl is started. We start Byebug before we start pry, so we've either got to do the Pry.initial_session_setup ourselves, or we've got to hook later into the process. I put the setup call in the start method for now.
Ok. Yeah, that works now @stephenprater. Awesome. :+1:
This is definitely required (as you know) to make pry invoke.
# ~/.pryrc
PryByebug.binding_behavior = :pry
I wonder if this would be the default if it's considered stable? @deivid-rodriguez
Guys, I'll be off until mid october or so. I'll review and consider this when I'm back.
Salud!
@deivid-rodriguez would you be able to take a look at this now? I'm running into https://github.com/ConradIrwin/pry-rescue/issues/71 and this would solve the problem for me. Thanks.
@russelldavis No, sorry... I'll let you know when I get to it, but don't know when that'll be. In the mid time, you can use this branch if it works for you!