class Middleman::PreviewServer::BasicInformation

Basic information class to wrap common behaviour

def initialize(opts={})

Parameters:
  • port (Integer) --
  • server_name (String) --
  • bind_address (String) --
def initialize(opts={})
  @bind_address = ServerIpAddress.new(opts[:bind_address])
  @server_name  = ServerHostname.new(opts[:server_name])
  @port         = opts[:port]
  @valid        = true
  @site_addresses = []
  @listeners = []
  @checks = []
  # This needs to be check for each use case. Otherwise `Webrick` will
  # complain about that.
  @checks << Checks::InterfaceIsAvailableOnSystem.new
end

def local_network_interfaces

Default is to get all network interfaces
def local_network_interfaces
  network_interfaces_inventory.nil? ? [] : network_interfaces_inventory.network_interfaces(:all)
end

def resolve_me(*)

def resolve_me(*)
  fail NoMethodError
end

def show_me_network_interfaces(inventory)

Parameters:
  • inventory (#network_interfaces) --
def show_me_network_interfaces(inventory)
  @network_interfaces_inventory = inventory
end

def valid?

Is the given information valid?
def valid?
  valid == true
end

def validate_me(validator)

Parameters:
  • validator (#validate) --
def validate_me(validator)
  validator.validate self, checks
end