Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable pry-like stop on binding.pry #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stephenprater
Copy link

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.

@stephenprater
Copy link
Author

The CI Fail is because of RuboCop - but it's not giving me any information - just "Hook raised unexpected error."

@squarism
Copy link

squarism commented Sep 3, 2015

Great analysis but unforunately, 😢 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

@stephenprater
Copy link
Author

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.

@squarism
Copy link

squarism commented Sep 3, 2015

Ok. Yeah, that works now @stephenprater. Awesome. 👍

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

@deivid-rodriguez
Copy link
Owner

Guys, I'll be off until mid october or so. I'll review and consider this when I'm back.

Salud!

@russelldavis
Copy link

@deivid-rodriguez would you be able to take a look at this now? I'm running into ConradIrwin/pry-rescue#71 and this would solve the problem for me. Thanks.

@deivid-rodriguez
Copy link
Owner

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants