Class: Nonnative::Ports

Inherits:
Object
  • Object
show all
Defined in:
lib/nonnative/ports.rb

Overview

Performs aggregate TCP readiness/shutdown checks for all configured runner ports.

A runner is considered ready only when every configured port is open, and stopped only when every configured port is closed.

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(runner) ⇒ Ports

Returns a new instance of Ports.

Parameters:

  • runner (#host, #ports, #timeout)

    runner configuration providing connection details



12
13
14
# File 'lib/nonnative/ports.rb', line 12

def initialize(runner)
  @ports = runner.ports.map { |port| Nonnative::Port.new(runner, port) }
end

Instance Method Details

#closed?Boolean

Returns whether all configured ports become non-connectable before their timeouts elapse.

Returns:

  • (Boolean)


26
27
28
# File 'lib/nonnative/ports.rb', line 26

def closed?
  ports.all?(&:closed?)
end

#open?Boolean

Returns whether all configured ports become connectable before their timeouts elapse.

Returns:

  • (Boolean)


19
20
21
# File 'lib/nonnative/ports.rb', line 19

def open?
  ports.all?(&:open?)
end