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



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

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



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

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

  check_status!

  success
end