Skip to content
Binding navigation commands for Pry to make a simple debugger
Branch: master
Clone or download
nixme Merge pull request #29 from rrosenblum/update_pry
Allow newer versions of pry to be used
Latest commit 54e51e5 Mar 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Avoid circular require when being loaded by 'pry' Sep 19, 2016
.gitignore
CHANGELOG.md Avoid circular require when being loaded by 'pry' Sep 19, 2016
Gemfile Use https when accessing rubygems Aug 27, 2016
LICENSE License Dec 3, 2011
README.md Move pry-byebug link back to the top of the README file Sep 19, 2016
Rakefile Initial attempt at basic 'step' and 'next' commands Nov 29, 2011
pry-nav.gemspec

README.md

Using MRI? We recommend pry-byebug instead!

pry-nav

A simple execution control add-on for Pry.

Compatible with JRuby >= 9.1.3.0.

Teaches Pry about step, next, and continue to create a simple debugger.

To use, invoke pry normally:

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

When using JRuby, you also need to run it with the --debug flag. You can also add the flag to your JRUBY_OPTS environment variable for it to apply when running any ruby command, but do note that even when not making use of pry this has a big impact on JRuby performance.

pry-nav is not yet thread-safe, so only use in single-threaded environments.

Rudimentary support for pry-remote (>= 0.1.1) is also included. Ensure pry-remote is loaded or required before pry-nav. For example, in a Gemfile:

gem 'pry'
gem 'pry-remote'
gem 'pry-nav'

Stepping through code often? Add the following shortcuts to ~/.pryrc:

Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'

Please note that debugging functionality is implemented through set_trace_func, which imposes a large performance penalty.

Contributors

Patches and bug reports are welcome. Just send a pull request or file an issue. Project changelog.

Acknowledgments

You can’t perform that action at this time.