-
Notifications
You must be signed in to change notification settings - Fork 0
/
.irbrc
38 lines (31 loc) · 781 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
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
IRB.conf[:VERBOSE] = true
IRB.conf[:SAVE_HISTORY] = 10000
IRB.conf[:USE_READLINE] = true
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.ruby_history"
module IRB
def self.start_session(binding)
IRB.setup(nil)
workspace = WorkSpace.new(binding)
if @CONF[:SCRIPT]
irb = Irb.new(workspace, @CONF[:SCRIPT])
else
irb = Irb.new(workspace)
end
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
@CONF[:MAIN_CONTEXT] = irb.context
trap("SIGINT") do
irb.signal_handle
end
catch(:IRB_EXIT) do
irb.eval_input
end
end
end
module Kernel
def self.irb
IRB.start_session(Kernel.binding)
end
end