Class: Hanami::CLI::SystemCall::Result
- Inherits:
-
Object
- Object
- Hanami::CLI::SystemCall::Result
- Defined in:
- lib/hanami/cli/system_call.rb
Overview
The result of a system call. Provides access to its standard out and error streams, plus whether the command executed successfully.
Instance Attribute Summary collapse
-
#err ⇒ IO
readonly
Returns the command's error ouptut stream.
-
#exit_code ⇒ Integer
readonly
Returns the command's exit code.
-
#out ⇒ IO
readonly
Returns the command's standard output stream.
Instance Method Summary collapse
-
#initialize(exit_code:, out:, err:) ⇒ Result
constructor
private
A new instance of Result.
-
#successful? ⇒ Boolean
Returns true if the command executed successfully (if its #exit_code is 0).
Constructor Details
#initialize(exit_code:, out:, err:) ⇒ Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Result.
50 51 52 53 54 |
# File 'lib/hanami/cli/system_call.rb', line 50 def initialize(exit_code:, out:, err:) @exit_code = exit_code @out = out @err = err end |
Instance Attribute Details
#err ⇒ IO (readonly)
Returns the command's error ouptut stream
46 47 48 |
# File 'lib/hanami/cli/system_call.rb', line 46 def err @err end |
#exit_code ⇒ Integer (readonly)
Returns the command's exit code
30 31 32 |
# File 'lib/hanami/cli/system_call.rb', line 30 def exit_code @exit_code end |
#out ⇒ IO (readonly)
Returns the command's standard output stream
38 39 40 |
# File 'lib/hanami/cli/system_call.rb', line 38 def out @out end |
Instance Method Details
#successful? ⇒ Boolean
Returns true if the command executed successfully (if its #exit_code is 0).
62 63 64 |
# File 'lib/hanami/cli/system_call.rb', line 62 def successful? exit_code == SUCCESSFUL_EXIT_CODE end |