-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.irbrc
executable file
·49 lines (42 loc) · 830 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
49
require 'pp'
require 'irb/completion'
require 'rubygems'
begin
require 'what_methods'
# wirble is amazing
require 'wirble'
Wirble.init
Wirble.colorize
rescue LoadError
# bundle console
end
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:SAVE_HISTORY] = 9999
# from http://themomorohoax.com/2009/03/27/irb-tip-load-files-faster
def ls
%x{ls}.split("\n")
end
def cd(dir)
Dir.chdir(dir)
Dir.pwd
end
def pwd
Dir.pwd
end
def meth(thing)
(thing.methods - Object.methods).sort
end
# also from http://themomorohoax.com/2009/03/27/irb-tip-load-files-faster
def reload(file_name = nil)
if file_name.nil?
reload(@recent)
else
puts "No recent file to reload"
end
else
file_name += '.rb' unless file_name =~ /\.rb/
@recent = file_name
load "#{file_name}"
end
end