module IRB

Public Class Methods

CurrentContext() click to toggle source
# File rake/lib/irb.rb, line 45
def IRB.CurrentContext
  IRB.conf[:MAIN_CONTEXT]
end
conf() click to toggle source
# File rake/lib/irb.rb, line 32
def IRB.conf
  @CONF
end
irb_abort(irb, exception = Abort) click to toggle source
# File rake/lib/irb.rb, line 86
def IRB.irb_abort(irb, exception = Abort)
  if defined? Thread
    irb.context.thread.raise exception, "abort then interrupt!"
  else
    raise exception, "abort then interrupt!"
  end
end
irb_at_exit() click to toggle source
# File rake/lib/irb.rb, line 78
def IRB.irb_at_exit
  @CONF[:AT_EXIT].each{|hook| hook.call}
end
irb_exit(irb, ret) click to toggle source
# File rake/lib/irb.rb, line 82
def IRB.irb_exit(irb, ret)
  throw :IRB_EXIT, ret
end
start(ap_path = nil) click to toggle source

initialize IRB and start TOP_LEVEL irb

# File rake/lib/irb.rb, line 50
  def IRB.start(ap_path = nil)
    $0 = File::basename(ap_path, ".rb") if ap_path

    IRB.setup(ap_path)

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

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

    trap("SIGINT") do
      irb.signal_handle
    end

    begin
      catch(:IRB_EXIT) do
        irb.eval_input
      end
    ensure
      irb_at_exit
    end
#    print "\n"
  end
version() click to toggle source

IRB version method

# File rake/lib/irb.rb, line 37
def IRB.version
  if v = @CONF[:VERSION] then return v end

  require "irb/version"
  rv = @RELEASE_VERSION.sub(/\.0/, "")
  @CONF[:VERSION] = format("irb %s(%s)", rv, @LAST_UPDATE_DATE)
end