Sha256: 37c69b9f3765521a2bb11af5e408a6b12d98b0b44f4ca02ca2e85045e6101b68

Contents?: true

Size: 455 Bytes

Versions: 23

Compression:

Stored size: 455 Bytes

Contents

class ConfigBuilder::Filter::Boxes

  attr_reader :boxes

  def set_config(root_config)
    @root_config = root_config
    @boxes       = (@root_config.delete('boxes') || {})
  end

  def run
    return @root_config if @root_config['vms'].nil?

    @root_config['vms'].each { |vm_hash| filter_vm(vm_hash) }
    @root_config
  end

  def filter_vm(vm_hash)
    if (box_name = vm_hash['box'])
      vm_hash['box_url'] ||= @boxes[box_name]
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
vagrant-config_builder-1.3.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-1.2.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-1.1.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-1.0.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-1.0.0.rc1 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.15.1 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.15.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.14.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.13.0 lib/config_builder/filter/boxes.rb
vagrant-masonry-0.13.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.12.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.11.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.10.1 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.10.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.9.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.8.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.7.1 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.7.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.6.0 lib/config_builder/filter/boxes.rb
vagrant-config_builder-0.5.0 lib/config_builder/filter/boxes.rb