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:, show: false) ⇒ CommandStdOut

Returns a new instance of CommandStdOut.



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

def initialize(step:, output:, show: false)
  @step   = step
  @output = output
  @show   = show
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.



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

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