Class: Sprinkle::Installers::Apt
- Defined in:
- lib/sprinkle/installers/apt.rb
Overview
Apt Package Installer
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
description "Beans beans they're good for your heart..."
apt 'magic_beans_package'
end
Second, only build the magic_beans dependencies:
package :magic_beans_depends do
apt 'magic_beans_package' { dependencies_only true }
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 collapse
-
#packages ⇒ Object
:nodoc:.
Attributes inherited from Installer
#delivery, #options, #package, #post, #pre
Attributes included from Configurable
Instance Method Summary collapse
-
#initialize(parent, *packages, &block) ⇒ Apt
constructor
:nodoc:.
Methods inherited from Installer
Methods included from Configurable
#assert_delivery, #defaults, #method_missing, #option?
Constructor Details
#initialize(parent, *packages, &block) ⇒ Apt
:nodoc:
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sprinkle/installers/apt.rb', line 32 def initialize(parent, *packages, &block) #:nodoc: packages.flatten! = { :dependencies_only => false } .update(packages.pop) if packages.last.is_a?(Hash) super parent, , &block @packages = packages end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Sprinkle::Configurable
Instance Attribute Details
#packages ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/sprinkle/installers/apt.rb', line 30 def packages @packages end |