Class: Bryton::Lite::Runner::Capture
- Inherits:
-
Object
- Object
- Bryton::Lite::Runner::Capture
- Defined in:
- lib/bryton/lite.rb
Overview
Executes the given command and captures the results.
Instance Method Summary collapse
-
#initialize(*cmd) ⇒ Capture
constructor
Executes the command with Open3.capture3 and holds on to the results.
-
#status ⇒ Process::Status
Returns the status of execution.
-
#stderr ⇒ String
Returns the content of STDERR from the execution.
-
#stdout ⇒ String
Returns the content of STDOUT from the execution.
-
#success? ⇒ Boolean
Returns the success or failure of the execution.
Constructor Details
#initialize(*cmd) ⇒ Capture
Executes the command with Open3.capture3 and holds on to the results.
204 205 206 |
# File 'lib/bryton/lite.rb', line 204 def initialize(*cmd) @results = Open3.capture3(*cmd) end |
Instance Method Details
#status ⇒ Process::Status
Returns the status of execution.
222 223 224 |
# File 'lib/bryton/lite.rb', line 222 def status return @results[2] end |
#stderr ⇒ String
Returns the content of STDERR from the execution.
216 217 218 |
# File 'lib/bryton/lite.rb', line 216 def stderr return @results[1] end |
#stdout ⇒ String
Returns the content of STDOUT from the execution.
210 211 212 |
# File 'lib/bryton/lite.rb', line 210 def stdout return @results[0] end |
#success? ⇒ Boolean
Returns the success or failure of the execution.
228 229 230 |
# File 'lib/bryton/lite.rb', line 228 def success? return status.success? end |