-
Notifications
You must be signed in to change notification settings - Fork 1
/
irbrc
49 lines (40 loc) · 1000 Bytes
/
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
# -*-ruby-*-
require 'irb/completion'
require 'rubygems'
require 'yaml'
require 'pp'
# start wirble (with color)
begin
require 'wirble'
Wirble.init
# Wirble.colorize unless IRB.conf[:PROMPT_MODE] == :INF_RUBY
rescue LoadError
end
def profile
t = Time.now
yield
"Took #{Time.now - t} seconds."
end
# Inspecting really long strings causes inf-ruby to get really, really slow.
# class String
# def inspect
# puts self
# end
# end
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
# http://gist.github.com/301904
# type "some_object.my_methods" in IRB for a
# less noisy exploration of what objects can do
class Object
def my_methods
base_object = case self
when Class then Class.new
when Module then Module.new
else Object.new
end
(methods - base_object.methods).sort
end
end