Coder Social home page Coder Social logo

pry-full's Introduction

pry-full

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

Dependent Gems

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

  • ? [].pop

  • $ [].pop

  • …etc.

Shows docs for dollar-vars and keywords

  • show-docmores

  • ? module

  • ? $`

An essential gem. Turns Pry into a steppable debugger.

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

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

  • Following calls into other libs.

Allows you to navigate the call stack.

  • So many. TODO = document some.

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

  • Shortens write-run-debug cycles when exceptions are involved.

  • Exploring causes of hard-to-replicate exceptions.

  • cd-cause to source of exceptions in code run within Pry

  • Rescues on test failure via require of pry-rescue/minitest and pry-rescue/rspec

An excellent tabcompletion gem. Having this dep enables new Pry stuff. Note that pry v0.9.10 doesn't have this feature, so you must use a repo version.

  • require 'x<tab>

  • {asdf: 1, hjkl: 2}[:a<tab>

  • Chain.of.calls.<tab> # Old pry completion was generic in this case.

Replacement for the undermaintained gist gem.

  • Improved implementation for Pry's gist command.

  • Check out the jist -h output on the CLI, by the way.

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).

  • 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

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")

Pop the current line into a text editor. In tpope's words, "Whenever I'm using IRB or Pry, my editor always feels too far away. Yes, there are [ways to] spawn an editor and evaluate the result, but that's not what I need. Usually I'm about 80 characters or so into a hairy one-liner when I think, "you know, I really wish I was in Vim right about now." In Bash, one can load the current command line into an editor with C-x C-e. And now, you can do so in IRB and Pry."

  • Ctrl+x, Ctrl+e or Ctrl+o (if in Emacs mode or Vi Insert Mode)

  • v or o (if in Vi Normal Mode)

Method-level git commands.

  • Blame/diff a specific method.

Mostly for Pry/Pry Plugin development, but can be useful interactively.

  • define-command 'r', 'rerun' do run 'history --replay -1' end

  • reload-command show-method

  • edit-command show-method

  • edit-command -p show-method

Not a Pry plugin, but a useful tool, still.

  • Gnarly objects. ap the_gnarly_obj

pry-full's People

Contributors

rking avatar

Stargazers

Abdullah Barrak avatar Wilson Sumanang avatar Dan W. avatar ohshhh avatar Wayne Walker avatar Josh Rieken avatar Marwan Aljubeh avatar Zander Hill avatar shadowbq avatar Govinda Fichtner avatar Márk Bartos avatar James Peterson avatar Gussan avatar Fumitake TANIGUCHI avatar

Watchers

James Cloos avatar  avatar Yared Getachew avatar  avatar  avatar

Forkers

zph rocknrollmarc

pry-full's Issues

Rubinius and pry-full

It seems as pry-full installs several debugger-* related gems as dependencies it won't work with Rubinius...

I get the following error

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/govinda/.rbenv/versions/rbx-2.1.1/bin/rbx extconf.rb
Ruby version 2.1.0 is not supported.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/govinda/.rbenv/versions/rbx-2.1.1/bin/rbx


Gem files will remain installed in /Users/govinda/.rbenv/versions/rbx-2.1.1/gems/gems/debugger-1.6.2 for inspection.
Results logged to /Users/govinda/.rbenv/versions/rbx-2.1.1/gems/gems/debugger-1.6.2/ext/ruby_debug/gem_make.out

An error occurred while installing debugger (1.6.2), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.2'` succeeds before bundling.

Is there a way to use pry-full with Rubinius?
I guess an easy workaround would be to just require all the different gems manually without the debugger-* gems...

Re-add awesome_print itself

pry-awesome_print currently busts paging, and besides it's not really what you always want.

Better is to be able to always toss in:

ap some_obj

So, this Issue refers to:

  • adding awesome_print as a dep of this gem.
  • require 'awesome_print' in lib/pry-full.rb
  • Maybe preconfigure? AwesomePrint.defaults = { :raw => true }
    This is big but it's kind of nice opinionation, IMO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.