class AutomateIt::ShellManager::WhichBase

ShellManager::WhichBase

Provides abstract helper methods for other drivers implementing the which.

Public Instance Methods

which!(command) click to toggle source

See ShellManager#which!

# File lib/automateit/shell_manager/which_base.rb, line 13
def which!(command)
  result = which(command)
  if result.nil?
    raise ArgumentError.new("command not found: #{command}")
  else
    true
  end
end

Protected Instance Methods

_which_helper(&block) click to toggle source
# File lib/automateit/shell_manager/which_base.rb, line 24
def _which_helper(&block)
  data = block.call
  data.strip! if data
  return (! data.blank? && File.exists?(data)) ? data : nil
end