Module: IRB

Defined in:
lib/ruby-debug/commands/irb.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.start_session(binding) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ruby-debug/commands/irb.rb', line 3

def self.start_session(binding)
  unless @__initialized
    args = ARGV
    ARGV.replace(ARGV.dup)
    IRB.setup(nil)
    ARGV.replace(args)
    @__initialized = true
  end
  
  workspace = WorkSpace.new(binding)

  irb = Irb.new(workspace)

  @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