class Middleman::PreviewServer::ServerNameIsIpInformation

If the server name is either an ipv4 or ipv6 address, e.g. 127.0.0.1 or ::1, use this one

Public Class Methods

matches?(opts={}) click to toggle source
# File lib/middleman-core/preview_server/information.rb, line 264
def self.matches?(opts={})
  ip = IPAddr.new(opts[:server_name])

  ip.ipv4? || ip.ipv6?
rescue
  false
end
new(opts={}) click to toggle source
# File lib/middleman-core/preview_server/information.rb, line 253
def initialize(opts={})
  super

  ip = ServerIpAddress.new(server_name.to_s)

  @listeners << ip
  @site_addresses << ip
end

Public Instance Methods

resolve_me(*) click to toggle source
# File lib/middleman-core/preview_server/information.rb, line 262
def resolve_me(*); end