Method: GDCM::Shell#run

Defined in:
lib/gdcm/shell.rb

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



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/gdcm/shell.rb', line 13

def run(command, options = {})
  stdout, stderr, status = execute(command, stdin: options[:stdin])

  if status != 0 && options.fetch(:whiny, GDCM.whiny)
    fail GDCM::Error, "`#{command.join(" ")}` failed with error:\n#{stderr}"
  end

  $stderr.print(stderr) unless options[:stderr] == false

  [stdout, stderr, status]
end