Module: Snipr
- Defined in:
- lib/snipr.rb,
lib/snipr/output.rb,
lib/snipr/version.rb,
lib/snipr/process_locator.rb,
lib/snipr/process_signaller.rb
Defined Under Namespace
Classes: ExecError, KernelProcess, Output, ProcessLocator, ProcessSignaller
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
-
.exec_cmd(command) ⇒ Object
Executes a command, returning the output as an array of lines.
Class Method Details
.exec_cmd(command) ⇒ Object
Executes a command, returning the output as an array of lines. Raises an ExecError if the command did not execute cleanly.
17 18 19 20 21 22 23 |
# 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 |