Module: Terminalwire::Server::Thor::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#terminalwire(arguments:, context:) ⇒ Object



60
61
62
63
64
65
66
67
# File 'lib/terminalwire/server/thor.rb', line 60

def terminalwire(arguments:, context:)
  # I have to manually hack into the Thor dispatcher to get access to the instance
  # of the CLI so I can slap the Rails helper methods in there, or other helpes
  # raise [context.inspect, arguments.inspect, self.inspect].inspect
  dispatch(nil, arguments.dup, nil, shell: terminalwire_shell(context)) do |instance|
    yield instance
  end
end

#terminalwire_shell(context) ⇒ Object



69
70
71
# File 'lib/terminalwire/server/thor.rb', line 69

def terminalwire_shell(context)
  Terminalwire::Server::Thor::Shell.new(context)
end