Class: Servitor::VeeweeBox
- Inherits:
-
Object
- Object
- Servitor::VeeweeBox
- Includes:
- ChildProcessHelper
- Defined in:
- lib/provisioners/veewee_box.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#os_name ⇒ Object
readonly
Returns the value of attribute os_name.
-
#os_version ⇒ Object
readonly
Returns the value of attribute os_version.
Class Method Summary collapse
Instance Method Summary collapse
- #build(options = {}) ⇒ Object
- #define ⇒ Object
-
#initialize(name, os_name, os_version, os_arch = nil) ⇒ VeeweeBox
constructor
A new instance of VeeweeBox.
Methods included from ChildProcessHelper
#execute_child_process, #execute_child_process_and_capture_output, included
Constructor Details
#initialize(name, os_name, os_version, os_arch = nil) ⇒ VeeweeBox
Returns a new instance of VeeweeBox.
26 27 28 29 30 31 32 |
# File 'lib/provisioners/veewee_box.rb', line 26 def initialize(name, os_name, os_version, os_arch=nil) raise InvalidNameError, name unless name =~ /^[a-zA-Z0-9\-]+$/ @name = name @os_name = os_name @os_version = os_version @os_arch = os_arch || '64' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
24 25 26 |
# File 'lib/provisioners/veewee_box.rb', line 24 def name @name end |
#os_name ⇒ Object (readonly)
Returns the value of attribute os_name.
24 25 26 |
# File 'lib/provisioners/veewee_box.rb', line 24 def os_name @os_name end |
#os_version ⇒ Object (readonly)
Returns the value of attribute os_version.
24 25 26 |
# File 'lib/provisioners/veewee_box.rb', line 24 def os_version @os_version end |
Class Method Details
.find(name) ⇒ Object
10 11 12 13 |
# File 'lib/provisioners/veewee_box.rb', line 10 def find(name) definition = self.veewee.definitions[name] VeeweeBox.new(name, nil, nil) if definition # we don't have the os name & version available end |
.vagrant ⇒ Object
19 20 21 |
# File 'lib/provisioners/veewee_box.rb', line 19 def vagrant VagrantBox.vagrant end |
.veewee ⇒ Object
15 16 17 |
# File 'lib/provisioners/veewee_box.rb', line 15 def veewee @veewee ||= Veewee::Environment.new end |
Instance Method Details
#build(options = {}) ⇒ Object
38 39 40 41 42 |
# File 'lib/provisioners/veewee_box.rb', line 38 def build(={}) build_args = ['vagrant', 'basebox', 'build', @name, '--auto'] build_args << '--nogui' if [:nogui] execute_child_process(*build_args) end |
#define ⇒ Object
34 35 36 |
# File 'lib/provisioners/veewee_box.rb', line 34 def define execute_child_process('vagrant', 'basebox', 'define', @name, template_name) end |