Changed log message when middleman starts.

Old message: == The Middleman is standing watch on port 4567
New message: == The Middleman is standing watch at http://0.0.0.0:4567

The URL in the message makes it clickable if the terminal supports it.
This commit is contained in:
Kunal Parikh 2012-11-11 13:16:47 +11:00 committed by Thomas Reynolds
parent 816bca9643
commit f6cf8de141

View file

@ -3,20 +3,22 @@ require "webrick"
module Middleman
module PreviewServer
DEFAULT_HOST = '0.0.0.0'
DEFAULT_PORT = 4567
class << self
attr_reader :app, :port
attr_reader :app, :host, :port
delegate :logger, :to => :app
# Start an instance of Middleman::Application
# @return [void]
def start(opts={})
@options = opts
@host = @options[:host] || DEFAULT_HOST
@port = @options[:port] || DEFAULT_PORT
mount_instance
logger.info "== The Middleman is standing watch on port #{port}"
logger.info "== The Middleman is standing watch at http://#{host}:#{port}"
@initialized ||= false
unless @initialized
@ -56,7 +58,7 @@ module Middleman
unmount_instance
mount_instance
logger.info "== The Middleman is standing watch on port #{port}"
logger.info "== The Middleman is standing watch at http://#{host}:#{port}"
end
# Stop the current instance, exit Webrick
@ -125,11 +127,9 @@ module Middleman
# Initialize webrick
# @return [void]
def setup_webrick(host, is_logging)
@host = host
def setup_webrick(is_logging)
http_opts = {
:BindAddress => @host,
:BindAddress => host,
:Port => port,
:AccessLog => []
}
@ -154,10 +154,7 @@ module Middleman
def mount_instance
@app = new_app
@webrick ||= setup_webrick(
@options[:host] || "0.0.0.0",
@options[:debug] || false
)
@webrick ||= setup_webrick(@options[:debug] || false)
start_file_watcher