Class: Methadone::ExecutionStrategy::Open_3

Inherits:
MRI
  • Object
show all
Defined in:
lib/methadone/execution_strategy/open_3.rb

Overview

Methadone Internal - treat as private

Implementation for modern Rubies that uses the built-in Open3 library

Instance Method Summary collapse

Methods inherited from MRI

#exception_meaning_command_not_found

Methods inherited from Base

#exception_meaning_command_not_found

Instance Method Details

#run_command(command) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/methadone/execution_strategy/open_3.rb', line 7

def run_command(command)
  stdout,stderr,status = case command
                         when String then Open3.capture3(command)
                         else Open3.capture3(*command)
                         end
  [stdout.chomp,stderr.chomp,status]
end