Module: VagrantPlugins::Skytap::Util::CompileForwardedPorts
- Includes:
- Vagrant::Util::ScopedHashOverride
- Included in:
- Action::ForwardPorts
- Defined in:
- lib/vagrant-skytap/util/compile_forwarded_ports.rb
Overview
This is based on code from the VirtualBox provider.
Instance Method Summary collapse
-
#compile_forwarded_ports(config) ⇒ Object
This method compiles the forwarded ports into [ForwardedPort] models.
Instance Method Details
#compile_forwarded_ports(config) ⇒ Object
This method compiles the forwarded ports into [ForwardedPort] models.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vagrant-skytap/util/compile_forwarded_ports.rb', line 34 def compile_forwarded_ports(config) mappings = {} config.vm.networks.each do |type, | if type == :forwarded_port guest_port = [:guest] host_port = [:host] protocol = [:protocol] || "tcp" = scoped_hash_override(, :skytap) id = [:id] # If the forwarded port was marked as disabled, ignore. next if [:disabled] mappings[host_port.to_s + protocol.to_s] = Model::ForwardedPort.new(id, host_port, guest_port, ) end end mappings.values end |