module Webgen::Utils::ExternalCommand
This module provides methods for easily working with external commands.
Public Class Methods
ensure_available!(cmd, *args)
click to toggle source
Raise an error if the given command is not available.
This just checks if the exit status is zero.
# File lib/webgen/utils/external_command.rb, line 14 def self.ensure_available!(cmd, *args) status = systemu([cmd, *args], 'stdout' => '', 'stdin' => '') raise Webgen::CommandNotFoundError.new(cmd) if status.exitstatus != 0 end