Class: GitLab::Exporter::CommandResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab_exporter/git.rb

Overview

Result of a command

Provides some handy methods for checking if the execution failed and a simple to_s that will return the command output

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



48
49
50
# File 'lib/gitlab_exporter/git.rb', line 48

def status
  @status
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



48
49
50
# File 'lib/gitlab_exporter/git.rb', line 48

def stdout
  @stdout
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/gitlab_exporter/git.rb', line 49

def failed?
  status.nonzero?
end

#to_sObject



57
58
59
# File 'lib/gitlab_exporter/git.rb', line 57

def to_s
  stdout
end