Class: Overcommit::CommandSplitter::Result
- Inherits:
-
Struct
- Object
- Struct
- Overcommit::CommandSplitter::Result
- Defined in:
- lib/overcommit/command_splitter.rb
Overview
Encapsulates the result of a split argument run.
Instance Attribute Summary collapse
-
#statuses ⇒ Array<Integer>
readonly
status codes for invocations.
-
#stderrs ⇒ Array<String>
readonly
standard error outputs from invocations.
-
#stdouts ⇒ Array<String>
readonly
standard outputs from invocations.
Instance Method Summary collapse
-
#status ⇒ true, false
Returns ‘0` if all invocations returned `0`; `1` otherwise.
-
#stderr ⇒ String
Returns concatenated standard error streams of all invocations in the order they were executed.
-
#stdout ⇒ String
Returns concatenated standard output streams of all invocations in the order they were executed.
-
#success? ⇒ true, false
Returns whether all invocations were successful.
Instance Attribute Details
#statuses ⇒ Array<Integer> (readonly)
status codes for invocations
21 22 23 |
# File 'lib/overcommit/command_splitter.rb', line 21 def statuses @statuses end |
#stderrs ⇒ Array<String> (readonly)
standard error outputs from invocations
21 22 23 |
# File 'lib/overcommit/command_splitter.rb', line 21 def stderrs @stderrs end |
#stdouts ⇒ Array<String> (readonly)
standard outputs from invocations
21 22 23 |
# File 'lib/overcommit/command_splitter.rb', line 21 def stdouts @stdouts end |
Instance Method Details
#status ⇒ true, false
Returns ‘0` if all invocations returned `0`; `1` otherwise.
32 33 34 |
# File 'lib/overcommit/command_splitter.rb', line 32 def status statuses.all? { |code| code == 0 } ? 0 : 1 end |
#stderr ⇒ String
Returns concatenated standard error streams of all invocations in the order they were executed.
48 49 50 |
# File 'lib/overcommit/command_splitter.rb', line 48 def stderr stderrs.join end |
#stdout ⇒ String
Returns concatenated standard output streams of all invocations in the order they were executed.
40 41 42 |
# File 'lib/overcommit/command_splitter.rb', line 40 def stdout stdouts.join end |
#success? ⇒ true, false
Returns whether all invocations were successful.
25 26 27 |
# File 'lib/overcommit/command_splitter.rb', line 25 def success? status == 0 end |