Class: Middleman::PreviewServer::ServerHostname::ServerPlainHostname
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Middleman::PreviewServer::ServerHostname::ServerPlainHostname
- Defined in:
- lib/middleman-core/preview_server/server_hostname.rb
Class Method Summary collapse
Instance Method Summary collapse
- #to_s ⇒ Object (also: #to_browser)
Class Method Details
.match?(name) ⇒ Boolean
21 22 23 24 25 |
# File 'lib/middleman-core/preview_server/server_hostname.rb', line 21 def self.match?(name) # rubocop:disable Style/CaseEquality name != 'localhost' && /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?\.?$/ === name # rubocop:enable Style/CaseEquality end |
Instance Method Details
#to_s ⇒ Object Also known as: to_browser
17 18 19 |
# File 'lib/middleman-core/preview_server/server_hostname.rb', line 17 def to_s __getobj__.gsub(/\s/, '+') + '.local' end |