class Nova::Shell

Constants

IRB_PROMPT

Public Instance Methods

start_shell() click to toggle source
# File lib/nova/shell.rb, line 14
def start_shell
  IRB.setup __FILE__
  IRB.conf[:PROMPT][:NOVA_PROMPT] = IRB_PROMPT
  IRB.conf[:PROMPT_MODE] = :NOVA_PROMPT
  irb = IRB::Irb.new(IRB::WorkSpace.new(binding))

  IRB.conf[:MAIN_CONTEXT] = irb.context

  trap("SIGINT") { irb.signal_handle }

  begin
    catch(:IRB_EXIT) { irb.eval_input }
  ensure
    IRB.irb_at_exit
  end
end