Module: VagrantPlugins::Parallels::Util::CompileForwardedPorts
- Includes:
- Vagrant::Util::ScopedHashOverride
- Included in:
- Action::ForwardPorts
- Defined in:
- lib/vagrant-parallels/util/compile_forwarded_ports.rb
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.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/vagrant-parallels/util/compile_forwarded_ports.rb', line 11 def compile_forwarded_ports(config) mappings = {} config.vm.networks.each do |type, | next unless type == :forwarded_port guest_port = [:guest] guest_ip = [:guest_ip] host_port = [:host] host_ip = [:host_ip] protocol = [:protocol] || 'tcp' = scoped_hash_override(, :parallels) id = [:id] # If the forwarded port was marked as disabled, ignore. next if [:disabled] # Temporary disable automatically pre-configured forwarded ports # for SSH, since it is working not so well [GH-146] next if id == 'ssh' mappings[host_port.to_s + protocol.to_s] = Model::ForwardedPort.new(id, host_port, guest_port, host_ip, guest_ip, **) end mappings.values end |