Print correct IP and mobile testing support

Address `0.0.0.0` wasn't valid on windows, use localhost instead
Finds a local IP that will also allow the development server to run on mobiles
This commit is contained in:
Eliott Appleford 2014-04-05 21:55:01 +01:00
parent a40ef1a734
commit e3946a06d9

View file

@ -15,7 +15,7 @@ module Middleman
# @return [void] # @return [void]
def start(opts={}) def start(opts={})
@options = opts @options = opts
@host = @options[:host] || Socket.gethostname @host = @options[:host] || Socket.ip_address_list.find(&:ipv4_private?).ip_address
@port = @options[:port] || DEFAULT_PORT @port = @options[:port] || DEFAULT_PORT
mount_instance(new_app) mount_instance(new_app)