#!/usr/bin/ruby -w # # This program is an interactive shell for Rumai. # # Usage: # # rumai [Options] # rumai [Options] -- Arguments # # Arguments: Command-line options and arguments that should # be passed to `irb`, the interactive Ruby shell. # # Options: # #-- # Copyright 2007 Suraj N. Kurapati # See the LICENSE file for details. #++ require 'rubygems' gem 'inochi', '~> 1' 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 context IRB.setup nil env = IRB::WorkSpace.new(context) irb = IRB::Irb.new(env) IRB.conf[:MAIN_CONTEXT] = irb.context catch :IRB_EXIT do irb.eval_input end end end IRB.start_session Rumai