Class: Middleman::PreviewServer::BindAddressAndServerNameInformation

Inherits:
BasicInformation
  • Object
show all
Defined in:
middleman-core/lib/middleman-core/preview_server/information.rb

Overview

Only used if bind address and server name are given and bind address is not :: or 0.0.0.0

Instance Attribute Summary

Attributes inherited from BasicInformation

#bind_address, #listeners, #port, #reason, #server_name, #site_addresses, #valid

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasicInformation

#local_network_interfaces, #show_me_network_interfaces, #valid?, #validate_me

Constructor Details

#initialize(*args) ⇒ BindAddressAndServerNameInformation

Returns a new instance of BindAddressAndServerNameInformation.


234
235
236
237
238
239
240
241
242
# File 'middleman-core/lib/middleman-core/preview_server/information.rb', line 234

def initialize(*args)
  super

  @listeners << bind_address
  @site_addresses << server_name
  @site_addresses << bind_address

  @checks << Checks::ServerNameResolvesToBindAddress.new
end

Class Method Details

.matches?(options_hash = ::Middleman::EMPTY_HASH) ⇒ Boolean

Returns:

  • (Boolean)

244
245
246
# File 'middleman-core/lib/middleman-core/preview_server/information.rb', line 244

def self.matches?(options_hash = ::Middleman::EMPTY_HASH)
  !options_hash[:bind_address].blank? && !options_hash[:server_name].blank? && !%w[:: 0.0.0.0].include?(options_hash[:bind_address])
end

Instance Method Details

#resolve_meObject


248
# File 'middleman-core/lib/middleman-core/preview_server/information.rb', line 248

def resolve_me(*); end