Class: Packer::Builder
- Inherits:
-
DataObject
- Object
- DataObject
- Packer::Builder
- Defined in:
- lib/packer/builder.rb,
lib/packer/builders/amazon.rb,
lib/packer/builders/docker.rb,
lib/packer/builders/virtualbox.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Amazon, Docker, UnrecognizedBuilderTypeError, VirtualBoxISO
Constant Summary collapse
- AMAZON_EBS =
'amazon-ebs'
- AMAZON_INSTANCE =
'amazon-instance'
- DOCKER =
'docker'
- VIRTUALBOX_ISO =
'virtualbox-iso'
- VALID_BUILDER_TYPES =
[ AMAZON_EBS, AMAZON_INSTANCE, DOCKER, VIRTUALBOX_ISO ]
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.
51 52 53 54 |
# File 'lib/packer/builder.rb', line 51 def initialize super self.add_required('type') end |
Class Method Details
.get_builder(type) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/packer/builder.rb', line 35 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 }.fetch(type).new end |
.types ⇒ Object
47 48 49 |
# File 'lib/packer/builder.rb', line 47 def self.types VALID_BUILDER_TYPES end |
Instance Method Details
#name(name) ⇒ Object
56 57 58 |
# File 'lib/packer/builder.rb', line 56 def name(name) self.__add_string('name', name) end |