Using 'Socket.gethostname' to get default hostname
As suggested by @bhollis in https://github.com/middleman/middleman/pull/665#issuecomment-10262763
This commit is contained in:
parent
f6cf8de141
commit
6f8ada6639
|
@ -3,7 +3,6 @@ require "webrick"
|
|||
module Middleman
|
||||
module PreviewServer
|
||||
|
||||
DEFAULT_HOST = '0.0.0.0'
|
||||
DEFAULT_PORT = 4567
|
||||
|
||||
class << self
|
||||
|
@ -14,7 +13,7 @@ module Middleman
|
|||
# @return [void]
|
||||
def start(opts={})
|
||||
@options = opts
|
||||
@host = @options[:host] || DEFAULT_HOST
|
||||
@host = @options[:host] || Socket.gethostname
|
||||
@port = @options[:port] || DEFAULT_PORT
|
||||
|
||||
mount_instance
|
||||
|
|
Loading…
Reference in a new issue