Class: Tap::Tasks::Console

Inherits:
Tap::Task
  • Object
show all
Defined in:
lib/tap/tasks/console.rb

Overview

:startdoc::task start an irb session

Console allows interaction with tap via IRB. Starts an IRB sssion with the same context as a tapfile (a Tap::Declarations::Context). Only one console can be running at time.

Defined Under Namespace

Modules: CleanExit

Instance Method Summary collapse

Instance Method Details

#processObject



34
35
36
37
38
39
40
# File 'lib/tap/tasks/console.rb', line 34

def process
  raise "console already running" if IRB.conf[:DEFAULT_OBJECT]
  IRB.conf[:DEFAULT_OBJECT] = Declarations::Context.new(app, "console")
  IRB.start
  IRB.conf[:DEFAULT_OBJECT] = nil
  IRB.CurrentContext.extend CleanExit
end