Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (39 sloc) 1014 Bytes
Pry.config.editor = proc { |file, line| "emacsclient +#{line} #{file}" }
Pry.config.pager = false if ENV["INSIDE_EMACS"]
Pry.config.ls.separator = '\n'
Pry.config.history.file = '.pry_history'
Pry.config.completer = nil if ENV["INSIDE_EMACS"]
Pry.config.correct_indent = false if ENV["INSIDE_EMACS"]
Pry.color = true
begin
require 'awesome_print'
AwesomePrint.pry!
rescue
end
if defined?(Rails)
def g(gid)
GlobalID::Locator.locate(gid)
end
def r
reload!
end
def log_off
puts "== Logging to log file."
ActiveRecord::Base.logger.level = 1 # warn (?)
nil
end
def log_on
puts "== Logging to console."
ActiveRecord::Base.logger.level = 0 # debug (?)
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