Class: AutomateIt::ShellManager::WhichBase

Inherits:
BaseDriver show all
Defined in:
lib/automateit/shell_manager/which_base.rb

Overview

ShellManager::WhichBase

Provides abstract helper methods for other drivers implementing the which.

Direct Known Subclasses

WhichUnix, WhichWindows

Constant Summary

Constants inherited from Plugin::Driver

Plugin::Driver::BASE_DRIVER_NAME

Constants included from Constants

Constants::HELPERS_DIR, Constants::INSTALL_DIR, Constants::PERROR, Constants::PEXEC, Constants::PNOTE, Constants::WARNING_BOILERPLATE

Instance Attribute Summary

Attributes inherited from Plugin::Driver

#manager

Attributes inherited from Common

#interpreter

Instance Method Summary collapse

Methods inherited from BaseDriver

#peer_for

Methods inherited from Plugin::Driver

abstract_driver, #available?, base_driver, base_driver?, depends_on, inherited, manager_token, #setup

Methods inherited from Plugin::Base

#setup, #token, token

Methods inherited from Common

#initialize, #log, #nitpick, #noop, #noop=, #noop?, #preview, #preview=, #preview?, #preview_for, #setup, #superuser?, #writing, #writing=, #writing?

Constructor Details

This class inherits a constructor from AutomateIt::Common

Instance Method Details

#suitability(method, *args) ⇒ Object

:nodoc:



7
8
9
10
# File 'lib/automateit/shell_manager/which_base.rb', line 7

def suitability(method, *args) # :nodoc:
  # Level must be higher than Portable
  return available? ? 2 : 0
end

#which!(command) ⇒ Object

See ShellManager#which!



13
14
15
16
17
18
19
20
# 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