Skip to content

Instantly share code, notes, and snippets.

@phallguy
Created June 5, 2014 21:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phallguy/7ba6446584c67d5c1624 to your computer and use it in GitHub Desktop.
Save phallguy/7ba6446584c67d5c1624 to your computer and use it in GitHub Desktop.
.pryrc for common aliases and shortcuts
# Save in ~/.pryrc
begin
require 'awesome_print'
rescue LoadError => err
puts "no awesome_print :("
end
begin
if defined?(PryDebugger)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
Pry.commands.alias_command 'wai', 'whereami'
end
rescue LoadError => err
puts err
end
Pry::Commands.command /^$/, "repeat last command" do
_pry_.run_command Pry.history.to_a.last
end
@sweetw0r
Copy link

[1] pry(#)> c
NameError: undefined local variable or method c' for #<Object:0x007ff5d3899010> from /Users/u491512/.rvm/gems/ruby-2.3.0/gems/rspec-expectations-3.4.0/lib/rspec/matchers.rb:966:inmethod_missing'
[2] pry(#)> wai
NameError: undefined local variable or method wai' for #<Object:0x007ff5d3899010> Did you mean? warn from /Users/u491512/.rvm/gems/ruby-2.3.0/gems/rspec-expectations-3.4.0/lib/rspec/matchers.rb:966:inmethod_missing'
[3] pry(#)> f
NameError: undefined local variable or method f' for #<Object:0x007ff5d3899010> from /Users/u491512/.rvm/gems/ruby-2.3.0/gems/rspec-expectations-3.4.0/lib/rspec/matchers.rb:966:inmethod_missing'
[4] pry(#)>

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