Class: Brut::TUI::Script::Events::CommandStdOut

Inherits:
Events::BaseEvent show all
Defined in:
lib/brut/tui/script/events/command_std_out.rb

Overview

Fired when a command has provided at least some output on its standard output.

Direct Known Subclasses

CommandStdErr

Instance Method Summary collapse

Methods inherited from Events::BaseEvent

#drain_then_exit?, #exit?, handler_method_name

Constructor Details

#initialize(step:, output:) ⇒ CommandStdOut

Returns a new instance of CommandStdOut.



3
4
5
6
# File 'lib/brut/tui/script/events/command_std_out.rb', line 3

def initialize(step:, output:)
  @step   = step
  @output = output
end

Instance Method Details

#deconstruct_keys(keys = nil) ⇒ Object

Adds description, command and output to the event keywords. output is a string containing whatever output was available. This is likely not terminated with a newline.



10
11
12
# File 'lib/brut/tui/script/events/command_std_out.rb', line 10

def deconstruct_keys(keys=nil)
  super.merge({ description: @step.description, command: @step.command, output: @output })
end