Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created July 25, 2012 21:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahoward/3178703 to your computer and use it in GitHub Desktop.
Save ahoward/3178703 to your computer and use it in GitHub Desktop.
pry without a prompt
def console!(&block)
require 'pry'
Pry.config.hooks.send(:hooks).keys.
each{|which| Pry.config.hooks.clear(which)}
prompt = ">> "
Pry.config.prompt = proc{|*a| prompt }
block.binding.pry
end
console!{}
@banister
Copy link

I'm curious why do you want to delete all the hooks?

Anyway you can try this code instead:

def console!(&block)
  require 'pry'
  block.binding.pry :hooks => Pry::Hooks.new, :prompt => Pry::SIMPLE_PROMPT
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment