Class: Kamal::Cli::Build::PortForwarding

Inherits:
Object
  • Object
show all
Defined in:
lib/kamal/cli/build/port_forwarding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hosts, port, **ssh_options) ⇒ PortForwarding

Returns a new instance of PortForwarding.



6
7
8
9
10
# File 'lib/kamal/cli/build/port_forwarding.rb', line 6

def initialize(hosts, port, **ssh_options)
  @hosts = hosts
  @port = port
  @ssh_options = ssh_options
end

Instance Attribute Details

#hostsObject (readonly)

Returns the value of attribute hosts.



4
5
6
# File 'lib/kamal/cli/build/port_forwarding.rb', line 4

def hosts
  @hosts
end

#portObject (readonly)

Returns the value of attribute port.



4
5
6
# File 'lib/kamal/cli/build/port_forwarding.rb', line 4

def port
  @port
end

#ssh_optionsObject (readonly)

Returns the value of attribute ssh_options.



4
5
6
# File 'lib/kamal/cli/build/port_forwarding.rb', line 4

def ssh_options
  @ssh_options
end

Instance Method Details

#forwardObject



12
13
14
15
16
17
18
19
# File 'lib/kamal/cli/build/port_forwarding.rb', line 12

def forward
  @done = false
  forward_ports

  yield
ensure
  stop
end