Class: Net::SSH::Service::Shell::SyncShell

Class | Net::SSH::Service::Shell::SyncShell
In: | lib/net/ssh/service/shell/sync.rb
Parent: | Object

A version of Shell::Shell that acts synchronously, allowing clients to execute a command via a shell, wait for it to finish, and then inspect both the stdout and stderr from the command, as well as the exit status.

### Methods

method_missing new open? send_command send_data send_extended_data

### Constants

CommandOutput | = | Struct.new( :stdout, :stderr, :status ) |  | A struct representing the result of executing a command.
CONFIRMATION | = | "2357foobarbazzabraboof7532" |  | The unique confirmation string that is used to recognize the end of a command‘s execution.

### Public Class methods

new( shell, log, pty_opts )

Create a new SyncShell that uses the given `shell` factory to obtain a shell to wrap. The other parameters are used

### Public Instance methods

method_missing( sym, *args )

Reinterprets missing methods as requests to execute commands. The parameters to the method are concatenated together with spaces and sent to the shell via send_command.

open?()

Delegates to Shell::Shell.open?

send_command( cmd, stdin=nil )

Attempts to invoke the given command, which must not be terminated with a newline. If `stdin` is not nil, it will be sent to the shell immediately after sending the request to execute the command. It is expected that this will be used by the program that was just executed somehow, but this is not (cannot) be enforced.

send_data( data )

Sends the given string directly to the shell, without waiting for any response.

send_extended_data( type, data )

Dends the given string directly to the shell as the given type of data, without waiting for any response.

[Validate]