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
|
# File 'lib/tupelo/app/irb-shell.rb', line 11
def IRB.start_session(*args)
unless $irb
IRB.setup nil
end
workspace = WorkSpace.new(*args)
@CONF[:PROMPT_MODE] = :SIMPLE
@CONF[:EVAL_HISTORY] = 1000
@CONF[:SAVE_HISTORY] = 100
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 'INT' do
$irb.signal_handle
end
custom_configuration if defined?(IRB.custom_configuration)
begin
catch :IRB_EXIT do
$irb.eval_input
end
ensure
IRB.irb_at_exit
end
end
|