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.
7 8 9 |
# File 'lib/isolation/command_runner.rb', line 7 def initialize(command) @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/isolation/command_runner.rb', line 3 def command @command end |
#error_message ⇒ Object
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/isolation/command_runner.rb', line 4 def end |
#success_status ⇒ Object Also known as: success?
Returns the value of attribute success_status.
4 5 6 |
# File 'lib/isolation/command_runner.rb', line 4 def success_status @success_status end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 |
# File 'lib/isolation/command_runner.rb', line 11 def run Open3.popen3(ENV, command) do |stdin, stdout, stderr, wait_thr| self.success_status = wait_thr.value.success? self. = stderr.read end end |