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
23 24 25 |
# File 'lib/overcommit/command_splitter.rb', line 23 def statuses @statuses end |
#stderrs ⇒ Array<String> (readonly)
standard error outputs from invocations
23 24 25 |
# File 'lib/overcommit/command_splitter.rb', line 23 def stderrs @stderrs end |
#stdouts ⇒ Array<String> (readonly)
standard outputs from invocations
23 24 25 |
# File 'lib/overcommit/command_splitter.rb', line 23 def stdouts @stdouts end |
Instance Method Details
#status ⇒ true, false
Returns ‘0` if all invocations returned `0`; `1` otherwise.
34 35 36 |
# File 'lib/overcommit/command_splitter.rb', line 34 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.
50 51 52 |
# File 'lib/overcommit/command_splitter.rb', line 50 def stderr stderrs.join end |
#stdout ⇒ String
Returns concatenated standard output streams of all invocations in the order they were executed.
42 43 44 |
# File 'lib/overcommit/command_splitter.rb', line 42 def stdout stdouts.join end |
#success? ⇒ true, false
Returns whether all invocations were successful.
27 28 29 |
# File 'lib/overcommit/command_splitter.rb', line 27 def success? status == 0 end |