Sha256: 224f676fd681b00a57ba1288d8ba7450bc11764eb065757863fe8d434298cb87

Contents?: true

Size: 995 Bytes

Versions: 6

Compression:

Stored size: 995 Bytes

Contents

# @see http://docs.vagrantup.com/v2/virtualbox/configuration.html
class ConfigBuilder::Model::Provider::Virtualbox < ConfigBuilder::Model::Base

  # @!attribute [rw] name
  #   @return [String] The name of the created VM in the Virtualbox GUI
  def_model_attribute :name

  # @!attribute [rw] customize
  #   @return [Array<String>] A list of customize arguments to use upon VM instantiation.
  def_model_attribute :customize

  # @!attribute [rw] gui
  #   @return [Boolean] Whether the GUI should be launched when the VM is created
  def_model_attribute :gui

  def initialize
    @defaults = {:customize => []}
  end

  def to_proc
    Proc.new do |vm_config|
      vm_config.provider 'virtualbox' do |vb_config|
        vb_config.name = attr(:name) if attr(:name)

        attr(:customize).each do |cmd|
          vb_config.customize cmd
        end

        vb_config.gui = attr(:gui) if attr(:gui)
      end
    end
  end

  ConfigBuilder::Model::Provider.register('virtualbox', self)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-config_builder-0.5.0 lib/config_builder/model/provider/virtualbox.rb
vagrant-config_builder-0.4.0 lib/config_builder/model/provider/virtualbox.rb
vagrant-config_builder-0.3.1 lib/config_builder/model/provider/virtualbox.rb
vagrant-config_builder-0.3.0 lib/config_builder/model/provider/virtualbox.rb
vagrant-config_builder-0.2.0 lib/config_builder/model/provider/virtualbox.rb
vagrant-config_builder-0.1.0 lib/config_builder/model/provider/virtualbox.rb