module Snipr

Constants

KernelProcess

Simple data structure representing a kernel process

VERSION

Public Class Methods

exec_cmd(command) click to toggle source

Executes a command, returning the output as an array of lines. Raises an ExecError if the command did not execute cleanly.

# File lib/snipr.rb, line 17
def self.exec_cmd(command)
  Open3.popen3(command) do |stdin, stdout, stderr|
    err = stderr.read
    raise ExecError, err unless err.empty?
    stdout.read.split("\n")
  end
end