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

Inherits:
BasicCheck
  • Object
show all
Defined in:
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



60
61
62
63
64
65
# File 'lib/middleman-core/preview_server/checks.rb', line 60

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

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