static public Method

IRB.start(ap_path = nil, main_context = nil, workspace = nil)

There's no documentation for this item.

Source Code

# File breakpoint.rb, line 444
def self.start(ap_path = nil, main_context = nil, workspace = nil)
  $0 = File::basename(ap_path, ".rb") if ap_path

  # suppress some warnings about redefined constants
  old_verbose, $VERBOSE = $VERBOSE, nil
  IRB.setup(ap_path)
  $VERBOSE = old_verbose

  if @CONF[:SCRIPT] then
    irb = Irb.new(main_context, @CONF[:SCRIPT])
  else
    irb = Irb.new(main_context)
  end

  if workspace then
    irb.context.workspace = workspace
  end

  @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
  @CONF[:MAIN_CONTEXT] = irb.context

  old_sigint = trap("SIGINT") do
    begin
      irb.signal_handle
    rescue RubyLex::TerminateLineInput
      # ignored
    end
  end

  catch(:IRB_EXIT) do
    irb.eval_input
  end
ensure
  trap("SIGINT", old_sigint)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.