Sha256: d38bc6bdbbef209e31611f4b669ed82e1c253ad2000bcd55b765ed1f8f41d18e

Contents?: true

Size: 799 Bytes

Versions: 13

Compression:

Stored size: 799 Bytes

Contents

# Model the root level Vagrant config object
#
# @see http://docs.vagrantup.com/v2/vagrantfile/index.html
class ConfigBuilder::Model::Root < ConfigBuilder::Model::Base

  include ConfigBuilder::ModelDelegator

  def_model_delegator :vagrant
  def_model_delegator :ssh
  def_model_delegator :vms


  def initialize
    @defaults = {:vms => [], :vagrant => {}}
  end

  def to_proc
    Proc.new do |root_config|
      eval_models(root_config)
    end
  end

  private

  def eval_vms(root_config)
    attr(:vms).each do |hash|
      v = ConfigBuilder::Model::VM.new_from_hash(hash)
      v.call(root_config)
    end
  end

  def eval_vagrant(root_config)
    if attr(:vagrant).has_key? :host
      root_config.vagrant.host = attr(:vagrant)[:host]
    end
  end

  def eval_ssh(root_config)

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vagrant-config_builder-0.10.1 lib/config_builder/model/root.rb
vagrant-config_builder-0.10.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.9.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.8.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.7.1 lib/config_builder/model/root.rb
vagrant-config_builder-0.7.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.6.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.5.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.4.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.3.1 lib/config_builder/model/root.rb
vagrant-config_builder-0.3.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.2.0 lib/config_builder/model/root.rb
vagrant-config_builder-0.1.0 lib/config_builder/model/root.rb