Permalink
Browse files

pry: Remove extended commands no longer available; extra aliases, log…

…ging
  • Loading branch information...
1 parent 0b58b0d commit 6be5ac0af1caa37c19fced11f07f6e85d0c15f31 @ches committed Feb 4, 2013
Showing with 14 additions and 3 deletions.
  1. +14 −3 .pryrc
View
17 .pryrc
@@ -12,16 +12,23 @@
#
# https://github.com/mon-ouie/pry_debug
# https://github.com/AndrewO/ruby-debug-pry
+#
+# Some nifty ideas: http://rbjl.net/49-railsrc-rails-console-snippets
-VIM = '/Applications/Development/MacVim.app/Contents/MacOS/Vim -f'
+VIM = '/Applications/MacVim.app/Contents/MacOS/Vim -f'
Pry.editor = proc { |file, line| "#{VIM} #{file} +#{line}" }
-Pry.config.commands.import Pry::ExtendedCommands::Experimental
-
# Example of custom prompt mucking
# Pry.config.prompt = proc { |obj, nest_level| "#{obj}:#{obj.instance_eval('_pry_').instance_variable_get('@output_array').count}> " }
# Pry.config.prompt = proc { |obj, nest_level| "#{obj}:#{obj.instance_eval('Pry').class_eval('@current_line')}> " }
+if Pry.plugins['debugger'].enabled
+ 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
+
begin
require 'hirb'
rescue LoadError
@@ -55,10 +62,14 @@ if defined?(Rails) && Rails.respond_to?(:logger) # Rails 3 style
if $db_logging_enabled
ActiveRecord::Base.logger = Logger.new(nil) if defined?(ActiveRecord)
Mongoid.logger = Logger.new(nil) if defined?(Mongoid)
+ Dalli.logger = Logger.new(nil) if defined?(Dalli)
+ Tire.configure { reset :logger } if defined?(Tire)
$db_logging_enabled = false
else
ActiveRecord::Base.logger = Rails.logger if defined?(ActiveRecord)
Mongoid.logger = Rails.logger if defined?(Mongoid)
+ Dalli.logger = Rails.logger if defined?(Dalli)
+ Tire.configure { logger $stdout } if defined?(Tire)
$db_logging_enabled = true
end
end

0 comments on commit 6be5ac0

Please sign in to comment.