Sha256: 4b4a5c8e4e1bb116035419291f010ce74155659e4ed2d31b4d1d534e58cd4736
Contents?: true
Size: 555 Bytes
Versions: 15
Compression:
Stored size: 555 Bytes
Contents
# -*- encoding: utf-8 -*- require 'webgen/error' require 'systemu' module Webgen module Utils # This module provides methods for easily working with external commands. module ExternalCommand # Raise an error if the given command is not available. # # This just checks if the exit status is zero. def self.ensure_available!(cmd, *args) status = systemu([cmd, *args], 'stdout' => '', 'stdin' => '') raise Webgen::CommandNotFoundError.new(cmd) if status.exitstatus != 0 end end end end
Version data entries
15 entries across 15 versions & 1 rubygems