Skip to content

Instantly share code, notes, and snippets.

@jpinnix
Created March 12, 2009 18:37
Show Gist options
  • Save jpinnix/78227 to your computer and use it in GitHub Desktop.
Save jpinnix/78227 to your computer and use it in GitHub Desktop.
.irbrc with wirble
# load libraries
require 'rubygems'
require 'wirble'
require 'pp'
alias q exit
# Easily print methods local to an object's class
class Object
def local_methods
(methods - Object.instance_methods).sort
end
end
# Log to STDOUT if in Rails
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
# start wirble (with color)
Wirble.init
Wirble.colorize
## get the default colors and add in your own
colors = Wirble::Colorize.colors.merge({
# delimiter colors
:comma => :blue,
:refers => :blue,
# container colors (hash and array)
:open_hash => :green,
:close_hash => :green,
:open_array => :green,
:close_array => :green,
# object colors
:open_object => :light_red,
:object_class => :white,
:object_addr_prefix => :blue,
:object_line_prefix => :blue,
:close_object => :light_red,
# symbol colors
:symbol => :yellow,
:symbol_prefix => :yellow,
# string colors
:open_string => :red,
:string => :cyan,
:close_string => :red,
# misc colors
:number => :cyan,
:keyword => :green,
:class => :light_green,
:range => :red,
})
# Colors to choose from:
# :nothing :green :light_purple
# :black :light_blue :purple
# :blue :light_cyan :red
# :brown :light_gray :white
# :cyan :light_green :yellow
# :dark_gray :light_red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment