Class: Middleman::PreviewServer::Checks::RequiresBindAddressIfServerNameIsGiven

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

Overview

This one requires a bind address if the user entered a server name

If the bind_address is blank this check will fail

Instance Method Summary collapse

Instance Method Details

#validate(information) ⇒ Object



68
69
70
71
72
73
74
75
76
# File 'middleman-core/lib/middleman-core/preview_server/checks.rb', line 68

def validate(information)
  return unless information.bind_address.blank?

  information.valid = false
  information.reason = format(
    'Server name "%<name>s" does not resolve to an ip address',
    name: information.server_name
  )
end