Class: Isolation::CommandRunner
- Inherits:
-
Object
- Object
- Isolation::CommandRunner
- Defined in:
- lib/isolation/command_runner.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#success_status ⇒ Object
(also: #success?)
Returns the value of attribute success_status.
Instance Method Summary collapse
-
#initialize(command) ⇒ CommandRunner
constructor
A new instance of CommandRunner.
- #run ⇒ Object
Constructor Details
#initialize(command) ⇒ CommandRunner
Returns a new instance of CommandRunner.
9 10 11 |
# File 'lib/isolation/command_runner.rb', line 9 def initialize(command) @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
5 6 7 |
# File 'lib/isolation/command_runner.rb', line 5 def command @command end |
#error_message ⇒ Object
Returns the value of attribute error_message.
6 7 8 |
# File 'lib/isolation/command_runner.rb', line 6 def @error_message end |
#success_status ⇒ Object Also known as: success?
Returns the value of attribute success_status.
6 7 8 |
# File 'lib/isolation/command_runner.rb', line 6 def success_status @success_status end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 |
# File 'lib/isolation/command_runner.rb', line 13 def run Open3.popen3(ENV, command) do |stdin, stdout, stderr, wait_thr| self.success_status = wait_thr.value.success? self. = stderr.read end end |