Class: Sprinkle::Installers::Apt

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

Instance Attribute Summary collapse

Attributes inherited from Installer

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

Instance Method Summary collapse

Methods inherited from Installer

#defaults, #method_missing, #process

Constructor Details

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

Returns a new instance of Apt.



6
7
8
9
10
11
12
13
14
15
# File 'lib/sprinkle/installers/apt.rb', line 6

def initialize(parent, *packages, &block)
  super parent, &block
  packages.flatten!
  
  options = { :dependencies_only => false }
  options.update(packages.pop) if packages.last.is_a?(Hash)
  
  @command = options[:dependencies_only] ? 'build-dep' : 'install'
  @packages = packages
end

Dynamic Method Handling

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

Instance Attribute Details

#packagesObject

Returns the value of attribute packages.



4
5
6
# File 'lib/sprinkle/installers/apt.rb', line 4

def packages
  @packages
end