exec_helpers.rb View source

Helpers: Exec helpers

Provides pretty_system which Mina uses to parse SSH output, and delegate to the appropriate Output helper.

pretty_system

Internal: A pretty version of the default #system commands, but indents and puts color.

Returns the exit code in integer form.

Handle ^C.

In the background, make stdin passthru, and stream stderr.

In the foreground, stream stdout to the output helper.

Private methods

Delegate functions, mostly.

Sys.handle_sigint!

Called when a ^C is pressed. The param count is how many times it's been pressed since. Returns nothing.

Sys.stream_stderr!

Internal: Read from stderr stream err [0], supress expected errors [1], and yield. Returns the PID.

Sys.stream_stdin!

Internal: Read from the real stdin stream and pass it onto the given stdin stream i. Returns the PID.

Sys.stream_stdout

Internal: Read from given stdout stream o and delegate it to the output helper.