Sha256: 2b11bcaf9ca1974afffb4286379afa06ead13a50af14eaacd35ba03458af0b7a

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

#!/usr/bin/env ruby
#
# 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 protects this work.
# See 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

1 entries across 1 versions & 1 rubygems

Version Path
rumai-3.2.0 bin/rumai