Sha256: 63523c27dc25ce664269a618e59d6a8320fafe510d07f9511e429a773f425f88

Contents?: true

Size: 446 Bytes

Versions: 1

Compression:

Stored size: 446 Bytes

Contents

require 'irb'

module IRB
  def self.start_session(binding)
    unless @__irb_initialized
      IRB.setup(nil)
      @__irb_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

    catch(:IRB_EXIT) do
      irb.eval_input
    end
  end
end

module Kernel
  def irb
    IRB.start_session(binding)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
irby-1.0.1 lib/irby.rb