-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirbrc
42 lines (35 loc) · 753 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
# based on @jerodsanto irb settings
# https://github.com/jerodsanto/dotfiles/blob/8ced1bda82c0ffb302013432f7e92157176a5cc7/irbrc
require "rubygems"
begin
require "awesome_print"
IRB::Irb.class_eval do
def output_value
ap @context.last_value
end
end
rescue LoadError
puts "*** awesome_print disabled ***"
require "pp"
end
begin
require "interactive_editor"
rescue LoadError
puts "*** interactive_editor disabled ***"
end
# quick benchmarking
# based on rue's irbrc => http://pastie.org/179534
def bm(repetitions=100, &block)
require "benchmark"
Benchmark.bmbm do |b|
b.report {repetitions.times &block}
end
nil
end
begin
require "pry"
Pry.start
exit
rescue LoadError
puts "*** pry disabled ***"
end