Project

pry-full18

0.0
No commit activity in last 3 years
No release in over 3 years
Pry plugins approved for 1.8: pry-remote + pry-rescue + pry-nav + pry-awesome_print + pry-highlight + pry-doc + pry-theme + pry-syntax-hacks + pry-pretty-numeric + pry-git
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

pry-full

Get up and going with a good set of pry tools right away.

Dependent Gems

Like its bigger, 1.9 brother pry-debugger, allows basic stepping

  • Making the basic "require'pry';binding.pry" from a script come alive.

  • In conjunction with pry-rescue, to explore failing tests.

  • Following calls into other libs.

Provides Pry.rescue do … end to capture any exceptions and start pry from the context of the source of the exception.

Starts Pry, listening on a socket, that you can then connect to.

  • Debugging odd glitches, like ones that only occur in production.

  • Cases like with pry-remote but where encryption/auth is needed.

  • …TODO: fill this list out

Allows you to look into the Ruby builtin classes with the ? and $ commands.

  • ? [].pop

  • $ [].pop

  • …etc.

An alternative printing style. A little funky, but more detailed than default Pry, especially for complex objects.

  • Compare the output of the large _pry_ object with and without this.

  • Array indices are shown, so you can enter them in the next REPL line.

  • If you want to see the old output, you can obj.inspect

Method-level git commands.

  • Blame/diff a specific method.

Reformat strings with pretty-printing. Auto-detects JSON/XML/Ruby.

  • After a method produces ugly XML, do ">>" by itself to see it prettied.

  • Pass in the string as an arg, e.g., >> '{"a":1}'

  • Pass in any Ruby as an arg, >> File.read("/var/www/foo.html")

Alternative syntax highlighting.

  • Being more snazzy

  • Making pry more like your editor, so you can scan more easily.

A very simple, but nice, plugin. Turns 12345689 into 12_345_689 on output (Which is legal Ruby input). Note that this currently gets hidden with the awesome_print output.

  • Any time you have big numbers.

Cirwin's wild bag of tricks. The caveat is that it's pretty wild and tricky. Especially since input with @s can get rewritten as an instance_variable_get. Still, this is only a matter of understanding the dialect used, and adapting accordingly.

  • Direct member access; User.new.@secret_password

  • Calling private methods; User.new.!hash_password('foo')

  • Accessing Pry outer bindings; cd (a = Object.new) then puts ../a

Other tips

As an alternative to bundle open somegem, there's this cool sequence: gem-cd somegem .zsh

This will drop you into a temporary shell in the install dir of the gem, where you can use ack and cat **/* | vim - +setf\ ruby and other familiar tools to explore new codebases.