Sha256: 3b8262661fadfde1d1057de2987ab91edd3b3a4c337152ec1d121792afcfa764
Contents?: true
Size: 714 Bytes
Versions: 13
Compression:
Stored size: 714 Bytes
Contents
# == ShellManager::WhichBase # # Provides abstract helper methods for other drivers implementing the +which+. class AutomateIt::ShellManager::WhichBase < AutomateIt::ShellManager::BaseDriver abstract_driver def suitability(method, *args) # :nodoc: # Level must be higher than Portable return available? ? 2 : 0 end # See ShellManager#which! def which!(command) result = which(command) if result.nil? raise ArgumentError.new("command not found: #{command}") else true end end protected def _which_helper(&block) data = block.call data.strip! if data return (! data.blank? && File.exists?(data)) ? data : nil end end
Version data entries
13 entries across 13 versions & 2 rubygems