Module: Terminalwire::V2::Server::Thor

Defined in:
lib/terminalwire/v2/server/thor.rb

Overview

Thor integration. Including this in a Thor CLI routes all of Thor's I/O — say, ask, yes?, and bare puts/print/gets inside commands — through the Terminalwire Context instead of the server's real $stdin/$stdout. This is what lets you keep writing an ordinary Thor CLI while it runs on the client.

Thor needs this dedicated adapter (rather than the generic Server.redirect) because its shell captures the output streams at construction instead of reading the $stdout/$stderr globals at call time. The byte plumbing is the shared Server::IO.

Defined Under Namespace

Modules: ClassMethods, Helpers Classes: Shell

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



63
64
65
66
# File 'lib/terminalwire/v2/server/thor.rb', line 63

def self.included(base)
  base.extend ClassMethods
  base.include Helpers
end