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 14 def self.ensure_available!(cmd, *args) 15 status = systemu([cmd, *args], 'stdout' => '', 'stdin' => '') 16 raise Webgen::CommandNotFoundError.new(cmd) if status.exitstatus != 0 17 end