How to use Pry with Sinatra?

Summary Use require ‘pry’ at the top of your application. Call binding.pry in your code whenever you want to drop into the interactive session. For information on using Pry, see Turning IRB on its head with Pry and the Pry wiki. When you are done with a particular interactive session, type exit or Ctrl-D; Sinatra … Read more

pry gem how to reload?

To use reload! like the rails console command, add this code to your .pryrc # load Rails Console helpers like reload require ‘rails/console/app’ extend Rails::ConsoleMethods puts ‘Rails Console Helpers loaded’ EDIT== Gem pry-rails already do all of this, much simplier .

tree command on osx bash

Using homebrew: brew install tree Using macports: sudo port install tree Using the source: Follow these directions. (Caveat; you should use the flags/etc. that make sense.) <rant>All systems should come with tree; I use it a lot. And we can post directory structures as text, not pics.</rant>

How to debug a rails app in docker with pry?

If you’re using docker-compose, you can add these flags to docker-compose.yml: app: tty: true stdin_open: true And then attach to your process with docker attach project_app_1. pry-rails works here now. Ensure less is installed on your container for the optimal pry experience. cf. https://github.com/docker/compose/issues/423#issuecomment-141995398

Pry: show me the stack

To do this without any pry plugins (I was having troubles with pry-stack_explorer), just look at caller. I actually look for my project name to filter out all the irrelevant rails stack items. For example, if my project name were archie I’d use: caller.select {|line| line.include? “archie” } Which gives me the stack trace I’m … Read more