vaguerent/lib/vagrant/config/container.rb
Mitchell Hashimoto 73a672cff1 load_config! is kind of working again.
Specifically: Global configuration load appears to be working. More
unit tests should reveal if proper VM configuration is loading.
2011-12-03 18:31:17 -08:00

35 lines
998 B
Ruby

module Vagrant
module Config
# Contains loaded configuration values and provides access to those
# values.
#
# This is the class returned when loading configuration and stores
# the completely loaded configuration values. This class is meant to
# be immutable.
class Container
attr_reader :global
# Initializes the configuration container.
#
# @param [Top] global Top-level configuration for the global
# applicatoin.
# @param [Array] vms Array of VM configurations.
def initialize(global, vms)
@global = global
@vms = {}
vms.each do |vm_config|
@vms[vm_config.vm.name] = vm_config
end
end
# This returns the configuration for a specific virtual machine.
# The values for this configuration are usually pertinent to a
# single virtual machine and do not affect the system globally.
def for_vm(name)
@vms[name]
end
end
end
end