Class AutomateIt::PackageManager::BaseDriver
In: lib/automateit/package_manager.rb
Parent: AutomateIt::Plugin::Driver

PackageManager::BaseDriver

Base class for all PackageManager drivers.

Methods

Protected Instance methods

Install these packages. Works like PackageManager#install but calls a block that‘s responsible for actually installing the packages and returning true if the installation succeeded. This block is only called if packages need to be installed and receives a filtered list of packages that are guaranteed not to be installed on the system already.

For example:

  _install_helper("package1", "package2", :quiet => true) do |packages, opts|
    # Dummy code that installs packages here, e.g:
    system("apt-get", "install", "-y", packages)
  end

Are these packages installed? Works like PackageManager#installed? but calls a block that actually checks whether the packages are installed and returns an array of packages installed.

For example:

  _installed_helper?("package1", "package2", :details => true) do |packages, opts|
    # Dummy code which reports that these packages are installed:
    ["package1]
  end

Returns a normalized array of packages. Transforms manifest string into packages. Turns symbols into string, strips blank lines and comments.

Are these packages not installed?

Uninstall these packages. Works like PackageManager#uninstall but calls a block that‘s responsible for actually uninstalling the packages and returning true if the uninstall succeeded. This block is only called if packages need to be uninstalled and receives a filtered list of packages that are guaranteed to be installed on the system.

For example:

  _uninstall_helper("package1", "package2", :quiet => true) do |packages, opts|
    # Dummy code that removes packages here, e.g:
    system("apt-get", "remove", "-y", packages)
  end

[Validate]