Skip to content

Instantly share code, notes, and snippets.

@cheald
Created April 29, 2015 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheald/71589940fc68d081645e to your computer and use it in GitHub Desktop.
Save cheald/71589940fc68d081645e to your computer and use it in GitHub Desktop.
def initialize
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:USE_READLINE] = true
IRB.setup(nil)
workspace = IRB::WorkSpace.new(binding)
irb = IRB::Irb.new(workspace)
IRB.conf[:IRB_RC].call irb.context if IRB.conf[:IRB_RC]
IRB.conf[:MAIN_CONTEXT] = irb.context
trap("SIGINT") { irb.signal_handle }
catch(:IRB_EXIT) { irb.eval_input }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment