-
Notifications
You must be signed in to change notification settings - Fork 0
/
irbrc
62 lines (49 loc) · 1.3 KB
/
irbrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require "rubygems"
require "pry"
Pry.start
exit
require "pp"
# sudo gem install wirble
require "wirble"
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 => :light_red,
:close_string => :red,
# misc colors
:number => :red,
:keyword => :green,
:class => :light_green,
:range => :red,
})
Wirble::Colorize.colors = colors
Wirble.init
Wirble.colorize
# 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