Class: Git::CommandLineResult
- Inherits:
-
Object
- Object
- Git::CommandLineResult
- Defined in:
- lib/git/command_line_result.rb
Overview
The result of running a git command
This object stores the Git command executed and its status, stdout, and stderr.
Instance Attribute Summary collapse
-
#git_cmd ⇒ Array<String>
readonly
The git command that was executed.
-
#status ⇒ Process::Status
readonly
The status of the process.
-
#stderr ⇒ String
readonly
The error output of the process.
-
#stdout ⇒ String
readonly
The output of the process.
Instance Method Summary collapse
-
#initialize(git_cmd, status, stdout, stderr) ⇒ CommandLineResult
constructor
Create a CommandLineResult object.
Constructor Details
#initialize(git_cmd, status, stdout, stderr) ⇒ CommandLineResult
Create a CommandLineResult object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/git/command_line_result.rb', line 26 def initialize(git_cmd, status, stdout, stderr) @git_cmd = git_cmd @status = status @stdout = stdout @stderr = stderr # ProcessExecuter::ResultWithCapture changed the timeout? method to timed_out? # in version 4.x. This is a compatibility layer to maintain the old method name # for backward compatibility. # status.define_singleton_method(:timeout?) { timed_out? } end |
Instance Attribute Details
#git_cmd ⇒ Array<String> (readonly)
The git command that was executed
50 51 52 |
# File 'lib/git/command_line_result.rb', line 50 def git_cmd @git_cmd end |
#status ⇒ Process::Status (readonly)
The status of the process
64 65 66 |
# File 'lib/git/command_line_result.rb', line 64 def status @status end |
#stderr ⇒ String (readonly)
The error output of the process
90 91 92 |
# File 'lib/git/command_line_result.rb', line 90 def stderr @stderr end |
#stdout ⇒ String (readonly)
The output of the process
77 78 79 |
# File 'lib/git/command_line_result.rb', line 77 def stdout @stdout end |