Skip to content

Instantly share code, notes, and snippets.

@techpeace
Created March 30, 2011 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techpeace/894787 to your computer and use it in GitHub Desktop.
Save techpeace/894787 to your computer and use it in GitHub Desktop.
require "rubygems"
module ActiveRecord; end
require "ap"
# Log to STDOUT if in Rails
if !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
unless IRB.version.include?('DietRB')
IRB::Irb.class_eval do
def output_value
ap @context.last_value
end
end
else # MacRuby
IRB.formatter = Class.new(IRB::Formatter) do
def inspect_object(object)
object.ai
end
end.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment