Class: PackerFiles::Debian::Apt

Inherits:
Core::Base show all
Defined in:
lib/PackerFiles/OS/Debian/Apt.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Apt

Constructor

Yields:

  • (_self)

Yield Parameters:



24
25
26
27
28
29
30
31
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 24

def initialize
	@tasks    = []
	@non_free = false
	@contrib  = false
	@upgrades = 'none'
   @kernel   = 'linux-server'
	yield self if block_given?
end

Instance Attribute Details

#contribObject

Returns the value of attribute contrib.



14
15
16
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 14

def contrib
  @contrib
end

#kernelObject

Returns the value of attribute kernel.



16
17
18
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 16

def kernel
  @kernel
end

#non_freeObject

Returns the value of attribute non_free.



13
14
15
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 13

def non_free
  @non_free
end

#tasksObject

Accessors



12
13
14
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 12

def tasks
  @tasks
end

#upgradesObject

Returns the value of attribute upgrades.



15
16
17
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 15

def upgrades
  @upgrades
end

Class Method Details

.doc_fileObject

Documentation for this class



19
20
21
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 19

def self.doc_file
   PackerFiles.DirPath('Debian/example/Apt.txt').first
end

Instance Method Details

#normalizeObject

Normalize

Raises:



34
35
36
37
38
# File 'lib/PackerFiles/OS/Debian/Apt.rb', line 34

def normalize
  raise Core::NilException.new(self, 'tasks') if @tasks.nil?
  raise Core::NilException.new(self, 'kernel') if @kernel.nil?
  raise Core::EmptyArrayException.new(self, 'tasks') if @tasks.empty?
end