#!/usr/bin/ruby -w # # This program is an interactive shell for Rumai. # # Usage: # # rumai [Options] # rumai [Options] -- irb_args # # irb_args: Command-line options and arguments that should # be passed to `irb`, the interactive Ruby shell. # # Options: # require 'rubygems' gem 'inochi', '~> 0' require 'inochi' Inochi.main :Rumai require 'irb' require 'irb/completion' module IRB # Starts an IRB session *inside* the given object. #-- # This code was adapted from a snippet on Massimiliano Mirra's website: # http://www.therubymine.com/articles/2007/01/29/programmare-dallinterno def self.start_session aContextObj setup nil session = Irb.new(WorkSpace.new(aContextObj)) @CONF[:MAIN_CONTEXT] = session.context catch(:IRB_EXIT) { session.eval_input } end end IRB.start_session Rumai