Skip to content

Instantly share code, notes, and snippets.

@simonista
Last active August 29, 2015 14:05
Show Gist options
  • Save simonista/07cc725afa2fd92250fb to your computer and use it in GitHub Desktop.
Save simonista/07cc725afa2fd92250fb to your computer and use it in GitHub Desktop.
Config files for awesome print
AwesomePrint.defaults = {
:indent => 2,
:sort_keys => true,
:color => {
:args => :greenish,
:array => :pale,
:bigdecimal => :blue,
:class => :yellow,
:date => :greenish,
:falseclass => :red,
:fixnum => :blue,
:float => :blue,
:hash => :pale,
:keyword => :cyan,
:method => :purpleish,
:nilclass => :red,
:string => :yellowish,
:struct => :pale,
:symbol => :cyanish,
:time => :greenish,
:trueclass => :green,
:variable => :cyanish
}
}
# encoding: UTF-8
require "rubygems"
require "awesome_print"
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