Method: Aggkit::Watcher::ProcessHandler.capture

Defined in:
lib/aggkit/watcher/process_handler.rb

.capture(cmd) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/aggkit/watcher/process_handler.rb', line 7

def self.capture(cmd)
  io = IO.popen(cmd)
  output = io.read
  begin
    io.close
  rescue StandardError
    nil
  end
  [output, $?]
end