Class Airbrussh::CommandFormatter
In: lib/airbrussh/command_formatter.rb
Parent: SimpleDelegator

Decorates an SSHKit Command to add string output helpers and the command‘s position within currently executing rake task:

  • position - zero-based position of this command in the list of
               all commands that have been run in the current rake task; in
               some cases this could be nil
    

Methods

Included Modules

Airbrussh::Colors

Public Class methods

Public Instance methods

Returns a green (success) or red (failure) message depending on the exit status.

exit_message # => "✔ 01 user@host 0.084s" exit_message # => "✘ 01 user@host 0.084s"

Prefixes the line with the command number and removes the newline.

format_output("hello\n") # => "01 hello"

Returns the abbreviated command (in yellow) with the number prefix.

start_message # => "01 echo hello"

[Validate]