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
1761197af3
commit
e57564c957
1 changed files with 1 additions and 2 deletions
|
@ -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