Skip to content

Instantly share code, notes, and snippets.

@cheald
Created July 24, 2015 06:15
Show Gist options
  • Save cheald/01820ce19baf867c9107 to your computer and use it in GitHub Desktop.
Save cheald/01820ce19baf867c9107 to your computer and use it in GitHub Desktop.
require "irb"
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 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment