Module: IRB

Defined in:
lib/dev-utils/debug/irb.rb

Overview

:stopdoc:

Class Method Summary collapse

Class Method Details

.parse_optsObject



133
134
135
# File 'lib/dev-utils/debug/irb.rb', line 133

def IRB.parse_opts
  # Don't touch ARGV, which belongs to the app which called this module.
end

.start_session(object) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/dev-utils/debug/irb.rb', line 137

def IRB.start_session(object)
  unless $irb
    IRB.setup nil
    ## maybe set some opts here, as in parse_opts in irb/init.rb?
  end

  @CONF[:PROMPT_MODE] = :SIMPLE

  workspace = WorkSpace.new(object)

  if @CONF[:SCRIPT] ## normally, set by parse_opts
    $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)

  catch :IRB_EXIT do
    $irb.eval_input
  end

  puts

  ## might want to reset your app's interrupt handler here
end