Class: Middleman::PreviewServer::ServerNameIsIpInformation
- Inherits:
-
BasicInformation
- Object
- BasicInformation
- Middleman::PreviewServer::ServerNameIsIpInformation
- Defined in:
- middleman-core/lib/middleman-core/preview_server/information.rb
Overview
If the server name is either an ipv4 or ipv6 address, e.g. 127.0.0.1 or ::1, use this one
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
-
#initialize(_options_hash = ::Middleman::EMPTY_HASH) ⇒ ServerNameIsIpInformation
constructor
A new instance of ServerNameIsIpInformation.
- #resolve_me ⇒ Object
Methods inherited from BasicInformation
#local_network_interfaces, #show_me_network_interfaces, #valid?, #validate_me
Constructor Details
#initialize(_options_hash = ::Middleman::EMPTY_HASH) ⇒ ServerNameIsIpInformation
Returns a new instance of ServerNameIsIpInformation.
254 255 256 257 258 259 260 261 |
# File 'middleman-core/lib/middleman-core/preview_server/information.rb', line 254 def initialize( = ::Middleman::EMPTY_HASH) super ip = ServerIpAddress.new(server_name.to_s) @listeners << ip @site_addresses << ip end |
Class Method Details
.matches?(options_hash = ::Middleman::EMPTY_HASH) ⇒ Boolean
265 266 267 268 269 270 271 |
# File 'middleman-core/lib/middleman-core/preview_server/information.rb', line 265 def self.matches?( = ::Middleman::EMPTY_HASH) ip = IPAddr.new([:server_name]) ip.ipv4? || ip.ipv6? rescue StandardError false end |
Instance Method Details
#resolve_me ⇒ Object
263 |
# File 'middleman-core/lib/middleman-core/preview_server/information.rb', line 263 def resolve_me(*); end |