Class: Vectory::SystemCall
- Inherits:
-
Object
- Object
- Vectory::SystemCall
- Defined in:
- lib/vectory/system_call.rb
Constant Summary collapse
- TIMEOUT =
60
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(cmd, timeout = TIMEOUT) ⇒ SystemCall
constructor
A new instance of SystemCall.
Constructor Details
#initialize(cmd, timeout = TIMEOUT) ⇒ SystemCall
Returns a new instance of SystemCall.
10 11 12 13 |
# File 'lib/vectory/system_call.rb', line 10 def initialize(cmd, timeout = TIMEOUT) @cmd = cmd @timeout = timeout end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
8 9 10 |
# File 'lib/vectory/system_call.rb', line 8 def cmd @cmd end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/vectory/system_call.rb', line 8 def status @status end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
8 9 10 |
# File 'lib/vectory/system_call.rb', line 8 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
8 9 10 |
# File 'lib/vectory/system_call.rb', line 8 def stdout @stdout end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/vectory/system_call.rb', line 15 def call log_cmd(@cmd) execute(@cmd) log_result raise_error unless @status.success? self end |