Sha256: 99c500bc4b90e5baf118c4f3adf58c08c0499e3ce47feb0687645deaf0dcf485
Contents?: true
Size: 581 Bytes
Versions: 19
Compression:
Stored size: 581 Bytes
Contents
require 'awesome_spawn' module LinuxAdmin module Common include Logging BIN_DIRS = %w(/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin) def self.cmd(name) BIN_DIRS.collect { |dir| "#{dir}/#{name}" }.detect { |cmd| File.exist?(cmd) } end def self.cmd?(name) !cmd(name).nil? end def self.run(cmd, options = {}) AwesomeSpawn.logger ||= logger AwesomeSpawn.run(cmd, options) end def self.run!(cmd, options = {}) AwesomeSpawn.logger ||= logger AwesomeSpawn.run!(cmd, options) end end end
Version data entries
19 entries across 19 versions & 1 rubygems