Added information about pry-nav for ruby debugging
This commit is contained in:
parent
cfe89df184
commit
0a921d3c1f
10
README.md
10
README.md
@ -187,12 +187,17 @@ an example.
|
|||||||
## Pry
|
## Pry
|
||||||
|
|
||||||
Pry (http://pry.github.com/) offers a much better out of the box IRB experience
|
Pry (http://pry.github.com/) offers a much better out of the box IRB experience
|
||||||
with colors, tab completion, and lots of other tricks. You should:
|
with colors, tab completion, and lots of other tricks. You can also use it
|
||||||
|
as an actual debugger by installing pry-nav (https://github.com/nixme/pry-nav) to
|
||||||
|
get colorized debugging that shows you where you are as you step through.
|
||||||
|
|
||||||
|
You should:
|
||||||
|
|
||||||
### Install the gem
|
### Install the gem
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
gem install pry
|
gem install pry
|
||||||
|
gem install pry-nav
|
||||||
gem install awesome_print
|
gem install awesome_print
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -200,16 +205,17 @@ gem install awesome_print
|
|||||||
|
|
||||||
* as irb: `pry`
|
* as irb: `pry`
|
||||||
* as rails console: `script/console --irb=pry`
|
* as rails console: `script/console --irb=pry`
|
||||||
|
* as a debugger: `require 'pry'; binding.pry` in your code (or just type `pry!<space>` to make vim do it)
|
||||||
|
|
||||||
### Pry Customizations:
|
### Pry Customizations:
|
||||||
|
|
||||||
* `clear` command to clear screen
|
* `clear` command to clear screen
|
||||||
* `sql` command to execute something (within a rails console)
|
* `sql` command to execute something (within a rails console)
|
||||||
|
* `c` (continue) `n` (next) `s` (step) commands for debugging using pry-nav
|
||||||
* all objects displayed in readable format (colorized, sorted hash keys) - via awesome_print
|
* all objects displayed in readable format (colorized, sorted hash keys) - via awesome_print
|
||||||
* a few color modifications to make it more useable
|
* a few color modifications to make it more useable
|
||||||
* type `help` to see all the commands
|
* type `help` to see all the commands
|
||||||
|
|
||||||
|
|
||||||
## Git
|
## Git
|
||||||
|
|
||||||
### User Info
|
### User Info
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
# === EDITOR ===
|
# === EDITOR ===
|
||||||
Pry.editor = 'vi'
|
Pry.editor = 'vi'
|
||||||
|
|
||||||
|
# == Pry-Nav - Using pry as a debugger ==
|
||||||
|
Pry.commands.alias_command 'c', 'continue'
|
||||||
|
Pry.commands.alias_command 's', 'step'
|
||||||
|
Pry.commands.alias_command 'n', 'next'
|
||||||
|
|
||||||
# === CUSTOM PROMPT ===
|
# === CUSTOM PROMPT ===
|
||||||
# This prompt shows the ruby version (useful for RVM)
|
# This prompt shows the ruby version (useful for RVM)
|
||||||
Pry.prompt = [proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }]
|
Pry.prompt = [proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, proc { |obj, nest_level, _| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }]
|
||||||
|
Loading…
Reference in New Issue
Block a user