Class: AutomateIt::PackageManager::APT

Inherits:
DPKG show all
Defined in:
lib/automateit/package_manager/apt.rb

Overview

PackageManager::APT

The APT driver for the PackageManager provides a way to manage software packages on Debian-style systems using apt-get and dpkg.

Constant Summary

Constants inherited from AutomateIt::Plugin::Driver

AutomateIt::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 AutomateIt::Plugin::Driver

#manager

Attributes inherited from Common

#interpreter

Instance Method Summary collapse

Methods inherited from DPKG

#installed?, #not_installed?, #uninstall

Methods inherited from AutomateIt::Plugin::Driver

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

Methods inherited from AutomateIt::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

#install(*packages) ⇒ Object

See AutomateIt::PackageManager#install



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/automateit/package_manager/apt.rb', line 13

def install(*packages)
  return _install_helper(*packages) do |list, opts|
    # apt-get options:
    # -y : yes to all queries
    # -q : no interactive progress bars
    cmd = "export DEBIAN_FRONTEND=noninteractive; apt-get install -y -q "+list.join(" ")+" < /dev/null"
    cmd << " > /dev/null" if opts[:quiet]
    cmd << " 2>&1"

    interpreter.sh(cmd)
  end
end

#suitability(method, *args) ⇒ Object

:nodoc:



8
9
10
# File 'lib/automateit/package_manager/apt.rb', line 8

def suitability(method, *args) # :nodoc:
  return available? ? 1 : 0
end