-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathirbrc
67 lines (61 loc) · 1.76 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
63
64
65
66
67
require 'pp'
require 'rubygems'
begin
# require 'wirble'
# Wirble.init(:history_size => 10000)
# Wirble.colorize
# Wirble::Colorize.colors = {
# # delimiter colors
# :comma => :white,
# :refers => :white,
#
# # container colors (hash and array)
# :open_hash => :white,
# :close_hash => :white,
# :open_array => :white,
# :close_array => :white,
#
# # object colors
# :open_object => :light_red,
# :object_class => :red,
# :object_addr_prefix => :blue,
# :object_line_prefix => :blue,
# :close_object => :light_red,
#
# # symbol colors
# :symbol => :blue,
# :symbol_prefix => :blue,
#
# # string colors
# :open_string => :light_green,
# :string => :light_green,
# :close_string => :light_green,
#
# # misc colors
# :number => :light_blue,
# :keyword => :orange,
# :class => :red,
# :range => :light_blue,
# }
rescue LoadError
puts "please run: `sudo gem install wirble`"
end
begin
# require 'hirb'
# Hirb.enable
rescue LoadError
puts "please run: `sudo gem install cldwalker-hirb --source http://gems.github.com`"
end
class Object
# Return a list of methods defined locally for a particular object. Useful
# for seeing what it does whilst losing all the guff that's implemented
# by its parents (eg Object).
def local_methods(obj = self)
(obj.methods - obj.class.superclass.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