Merge pull request #665 from techthumb/master
Changed log message when middleman starts.
This commit is contained in:
commit
4ef92481af
1 changed files with 17 additions and 21 deletions
|
@ -6,17 +6,18 @@ module Middleman
|
|||
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] || Socket.gethostname
|
||||
@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 +57,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 +126,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 +153,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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue