Class: Packer::Builder
- Inherits:
-
DataObject
- Object
- DataObject
- Packer::Builder
- Defined in:
- lib/packer/builder.rb,
lib/packer/builders/null.rb,
lib/packer/builders/amazon.rb,
lib/packer/builders/docker.rb,
lib/packer/builders/virtualbox.rb,
lib/packer/builders/vmware_vmx.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Amazon, Docker, Null, UnrecognizedBuilderTypeError, VMWareVMX, VirtualBoxISO
Constant Summary collapse
- AMAZON_EBS =
'amazon-ebs'
- AMAZON_INSTANCE =
'amazon-instance'
- DOCKER =
'docker'
- VIRTUALBOX_ISO =
'virtualbox-iso'
- VMWARE_VMX =
'vmware-vmx'
- NULL =
'null'
- VALID_BUILDER_TYPES =
[ AMAZON_EBS, AMAZON_INSTANCE, DOCKER, VIRTUALBOX_ISO, VMWARE_VMX, NULL ]
Instance Attribute Summary
Attributes inherited from DataObject
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #name(name) ⇒ Object
Methods inherited from DataObject
#__add_array_of_array_of_strings, #__add_array_of_hashes, #__add_array_of_strings, #__add_boolean, #__add_hash, #__add_integer, #__add_string, #__exclusive_key_error, #add_required, #deep_copy, #validate
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
43 44 45 46 |
# File 'lib/packer/builder.rb', line 43 def initialize super self.add_required('type') end |
Class Method Details
.get_builder(type) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/packer/builder.rb', line 25 def self.get_builder(type) unless validate_type(type) raise UnrecognizedBuilderTypeError.new("Unrecognized builder type #{type}") end { AMAZON_EBS => Packer::Builder::Amazon::EBS, AMAZON_INSTANCE => Packer::Builder::Amazon::Instance, DOCKER => Packer::Builder::Docker, VIRTUALBOX_ISO => Packer::Builder::VirtualBoxISO, VMWARE_VMX => Packer::Builder::VMWareVMX, NULL => Packer::Builder::Null }.fetch(type).new end |
.types ⇒ Object
39 40 41 |
# File 'lib/packer/builder.rb', line 39 def self.types VALID_BUILDER_TYPES end |
Instance Method Details
#name(name) ⇒ Object
48 49 50 |
# File 'lib/packer/builder.rb', line 48 def name(name) self.__add_string('name', name) end |