Class: Sprinkle::Installers::Apt

Inherits:
PackageInstaller show all
Defined in:
lib/sprinkle/installers/apt.rb

Overview

The Apt package installer uses the apt-get command to install packages. The apt installer has only one option which can be modified which is the dependencies_only option. When this is set to true, the installer uses build-dep instead of install to only build the dependencies.

Example Usage

First, a simple installation of the magic_beans package:

package :magic_beans do
  apt 'magic_beans_package'
  verify { has_apt 'magic_beans_package' }
end

Second, only build the magic_beans dependencies:

package :magic_beans_depends do
  apt 'magic_beans_package' do
    dependencies_only true 
  end
end

As you can see, setting options is as simple as creating a block and calling the option as a method with the value as its parameter.

Instance Attribute Summary

Attributes inherited from PackageInstaller

#packages

Attributes inherited from Installer

#delivery, #options, #package, #post, #pre

Instance Method Summary collapse

Methods inherited from PackageInstaller

auto_api, #install_package

Methods inherited from Installer

#announce, api, #commands_from_block, #defer, #escape_shell_arg, inherited, #install_sequence, #method_missing, #per_host?, #post_process, #process, subclasses, verify_api

Methods included from Sudo

#sudo?, #sudo_cmd, #sudo_stack

Methods included from Attributes

#defaults, #set_defaults

Constructor Details

#initialize(parent, *packages, &block) ⇒ Apt

:nodoc:


30
31
32
33
# File 'lib/sprinkle/installers/apt.rb', line 30

def initialize(parent, *packages, &block) #:nodoc:
  super parent, *packages, &block
  @options.reverse_merge!(:dependencies_only => false)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sprinkle::Installers::Installer