Skip to content

Commit

Permalink
Add pry debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletolle committed Oct 2, 2015
1 parent 968556e commit f461ac6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .pryrc
@@ -1,7 +1,7 @@
# Taken from: https://gist.github.com/jpastika/4fa9e02ffafcb6aae949
# Load plugins (only those I whitelist)
Pry.config.should_load_plugins = false
require 'pry-debugger'
require 'pry-byebug'

# Launch Pry with access to the entire Rails stack.
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead.
Expand Down Expand Up @@ -30,6 +30,17 @@ if File.exist?(rails) && ENV['SKIP_RAILS'].nil?
end
end

if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end

Pry::Commands.command /^$/, "repeat last command" do
_pry_.run_command Pry.history.to_a.last
end

# Idea from: http://stackoverflow.com/questions/15536815/opening-the-pry-console-in-sandbox-mode
def sandbox
require 'active_record/railties/console_sandbox'
Expand Down

0 comments on commit f461ac6

Please sign in to comment.