Class: CleoQualityReview::CommandResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/cleo_quality_review/command_result.rb

Overview

Value object representing the result of a shell command execution

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#statusProcess::Status (readonly)

Returns process exit status.

Returns:

  • (Process::Status)

    process exit status



13
14
15
16
17
18
19
20
# File 'lib/cleo_quality_review/command_result.rb', line 13

CommandResult = Struct.new(:stdout, :stderr, :status, keyword_init: true) do
  ##
  # Check if the command succeeded
  # @return [Boolean]
  def success?
    status.success?
  end
end

#stderrString (readonly)

Returns standard error from the command.

Returns:

  • (String)

    standard error from the command



13
14
15
16
17
18
19
20
# File 'lib/cleo_quality_review/command_result.rb', line 13

CommandResult = Struct.new(:stdout, :stderr, :status, keyword_init: true) do
  ##
  # Check if the command succeeded
  # @return [Boolean]
  def success?
    status.success?
  end
end

#stdoutString (readonly)

Returns standard output from the command.

Returns:

  • (String)

    standard output from the command



13
14
15
16
17
18
19
20
# File 'lib/cleo_quality_review/command_result.rb', line 13

CommandResult = Struct.new(:stdout, :stderr, :status, keyword_init: true) do
  ##
  # Check if the command succeeded
  # @return [Boolean]
  def success?
    status.success?
  end
end

Instance Method Details

#success?Boolean

Check if the command succeeded

Returns:

  • (Boolean)


17
18
19
# File 'lib/cleo_quality_review/command_result.rb', line 17

def success?
  status.success?
end