Class: Spidy::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/spidy/shell.rb

Overview

spidy Shell

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Shell

Returns a new instance of Shell.



5
6
7
# File 'lib/spidy/shell.rb', line 5

def initialize(path)
  @definition_file = Spidy::DefinitionFile.open(path)
end

Instance Method Details

#command_lineObject



18
19
20
# File 'lib/spidy/shell.rb', line 18

def command_line
  Spidy::CommandLine.new(@definition_file)
end

#interactiveObject



9
10
11
12
13
14
15
16
# File 'lib/spidy/shell.rb', line 9

def interactive
  console = Spidy::Console.new(@definition_file)
  require 'irb'
  IRB.setup(nil)
  irb = IRB::Irb.new(IRB::WorkSpace.new(console))
  IRB.conf[:MAIN_CONTEXT] = irb.context
  irb.eval_input
end