Reference
- Pry
- Hirb ### pry-remote Add the pry-remote gem.
# In your code:
binding.remote_pry
# In the shell:
bundle exec pry-remote
pry-rescue
Add the pry-rescue gem.
Pry::rescue {
# raise exceptions here
}
Or run:
bundle exec rescue rspec
Additional commands:
pry(main)> cd-cause
pry(main)> try-again
hirb
Add the hirb gem.
> table User.all
> view User.all
> view User.all, fields: %w[id name email]
Shell integration
shell-mode adds dir to the prompt.
pry(main)> shell-mode
pry(main):/home/x $
Commands with .
are shell commands.
pry(main)> .cat hello.txt
[Rails] ls
> ls # All
> ls -m # Methods
> ls -M # Instance methods
> ls -g # Globals
> ls -l # Local vars
> ls -c # Constants
> ls -i # Instance vars
> ls -G xx # Grey by regex
[Rails] Rails
> show-models
> show-routes
> show-middleware
[Rails] Rails console
Also consider pry-rails.
$ pry -r ./config/environment
Misc commands
> hist # History
> wtf? # Trace of recent exception
Gems
> gem-cd foo # Switch to gem's dir
> gem-install foo
> gem-list
Latest comments (0)