Method: GDCM::Shell#execute

Defined in:
lib/gdcm/shell.rb

#execute(command, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/gdcm/shell.rb', line 25

def execute(command, options = {})
  stdout, stderr, status =
    log(command.join(" ")) do
      send("execute_#{GDCM.shell_api.gsub("-", "_")}", command, options)
    end

  [stdout, stderr, status.exitstatus]
rescue Errno::ENOENT, IOError
  ["", "executable not found: \"#{command.first}\"", 127]
end