Sha256: 40203666835de68e674dcc6bc785effcc298af51a7798c83462200e3b85dc799
Contents?: true
Size: 674 Bytes
Versions: 18
Compression:
Stored size: 674 Bytes
Contents
# == ShellManager::Which # # A ShellManager driver providing access to the +which+ command found on # Unix-like systems. class AutomateIt::ShellManager::Which < AutomateIt::ShellManager::BaseDriver depends_on :programs => %w(which) def suitability(method, *args) # :nodoc: # Level must be higher than Portable return available? ? 2 : 0 end # See ShellManager#which def which(command) data = `which "#{command}" 2>&1`.chomp return (! data.blank? && File.exists?(data)) ? data : nil end # See ShellManager#which! def which!(command) if which(command).nil? raise ArgumentError.new("command not found: #{command}") end end end
Version data entries
18 entries across 18 versions & 1 rubygems