Class: Spidy::Shell
- Inherits:
-
Object
- Object
- Spidy::Shell
- Defined in:
- lib/spidy/shell.rb
Overview
spidy Shell
Instance Method Summary collapse
- #command_line ⇒ Object
-
#initialize(path) ⇒ Shell
constructor
A new instance of Shell.
- #interactive ⇒ Object
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_line ⇒ Object
18 19 20 |
# File 'lib/spidy/shell.rb', line 18 def command_line Spidy::CommandLine.new(@definition_file) end |
#interactive ⇒ Object
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 |