Sha256: 6130c87ea6c88f0e26ad74ff57d7f938d617ad1f3fcc78517885f6b674196741

Contents?: true

Size: 955 Bytes

Versions: 2

Compression:

Stored size: 955 Bytes

Contents

#!/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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rumai-2.1.0 bin/rumai
rumai-3.0.0 bin/rumai