Class: Vmx
- Includes:
- Dslify
- Defined in:
- lib/poolparty/net/remoter_bases/vmrun/utilities/vmx.rb
Overview
Vmx file creator
Usage:
Vmx.new({
:name => "MyPP",
:vmx_disk => {
:image_size => "2G"
},
:base_directory => "/tmp/vmx"
}).compile
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(o = {}) ⇒ Vmx
constructor
A new instance of Vmx.
Constructor Details
#initialize(o = {}) ⇒ Vmx
Returns a new instance of Vmx.
21 22 23 24 25 |
# File 'lib/poolparty/net/remoter_bases/vmrun/utilities/vmx.rb', line 21 def initialize(o={}) o @vmx_file = VmxFile.new o @vmx_disk = VmxDisk.new o end |
Instance Method Details
#compile ⇒ Object
27 28 29 30 31 32 |
# File 'lib/poolparty/net/remoter_bases/vmrun/utilities/vmx.rb', line 27 def compile ::FileUtils.mkdir_p "#{base_directory}/#{options[:name]}" vmdk = @vmx_disk.compile @vmx_file.set("ide0:0.fileName", vmdk) @vmx_file.compile end |