Sha256: 8e7786a6b65de3f9f45a0ba90b0ac49c9827201ba34664a77bb9136f91cde34f

Contents?: true

Size: 854 Bytes

Versions: 13

Compression:

Stored size: 854 Bytes

Contents

require "vagrant/util/scoped_hash_override"

module VagrantPlugins
  module ProviderVirtualBox
    module Util
      module CompileForwardedPorts
        include Vagrant::Util::ScopedHashOverride

        # This method compiles the forwarded ports into {ForwardedPort}
        # models.
        def compile_forwarded_ports(config)
          mappings = {}

          config.vm.networks.each do |type, options|
            if type == :forwarded_port
              guest_port = options[:guest]
              host_port  = options[:host]
              options    = scoped_hash_override(options, :virtualbox)
              id         = options[:id]

              mappings[host_port] =
                Model::ForwardedPort.new(id, host_port, guest_port, options)
            end
          end

          mappings.values
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/providers/virtualbox/util/compile_forwarded_ports.rb
tnargav-1.2.3 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/plugins/providers/virtualbox/util/compile_forwarded_ports.rb
tnargav-1.2.2 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrantup-1.1.3 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrantup-1.1.2 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrantup-1.1.1 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrantup-1.1.0 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrantup-1.1.4 plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/plugins/providers/virtualbox/util/compile_forwarded_ports.rb
vagrant-lxc-0.0.1 vendor/vagrant/plugins/providers/virtualbox/util/compile_forwarded_ports.rb