Module: ImageOptim::Cmd

Defined in:
lib/image_optim/cmd.rb

Overview

Helper for running commands

Class Method Summary collapse

Class Method Details

.capture(cmd) ⇒ Object

Run using backtick Return captured output Will raise SignalException if process was interrupted


21
22
23
24
25
26
27
# File 'lib/image_optim/cmd.rb', line 21

def capture(cmd)
  output = `#{cmd}`

  check_status!

  output
end

.run(*args) ⇒ Object

Run using `system` Return success status Will raise SignalException if process was interrupted


10
11
12
13
14
15
16
# File 'lib/image_optim/cmd.rb', line 10

def run(*args)
  success = system(*args)

  check_status!

  success
end