hide webrick logs, disable livereload by default

This commit is contained in:
Thomas Reynolds 2011-07-23 21:28:01 -07:00
parent f585a11d66
commit 506148ae8a
2 changed files with 9 additions and 3 deletions

View file

@ -15,7 +15,7 @@ module Middleman
class_option :port, :aliases => "-p", :default => "4567" class_option :port, :aliases => "-p", :default => "4567"
class_option :"livereload-port", :default => "35729" class_option :"livereload-port", :default => "35729"
class_option :"livereload", :default => true, :type => :boolean class_option :"livereload", :default => false, :type => :boolean
def start_guard def start_guard
if !File.exists?("config.rb") if !File.exists?("config.rb")

View file

@ -1,6 +1,7 @@
require "guard" require "guard"
require "guard/guard" require "guard/guard"
require "guard/livereload" require "guard/livereload"
require "webrick"
module Middleman::Guard module Middleman::Guard
def self.start(options={}, livereload={}) def self.start(options={}, livereload={})
@ -53,12 +54,17 @@ module Guard
private private
def server_start def server_start
puts "== The Middleman is standing watch on port #{@options[:port]}" @server_options = {
@server_options = { :Port => @options[:port], :AccessLog => [] } :Port => @options[:port],
:Logger => ::WEBrick::Log.new('/dev/null'),
:AccessLog => ::WEBrick::Log.new('/dev/null')
}
@server_job = fork do @server_job = fork do
@server_options[:app] = ::Middleman.server.new @server_options[:app] = ::Middleman.server.new
::Rack::Server.new(@server_options).start ::Rack::Server.new(@server_options).start
end end
puts "== The Middleman is standing watch on port #{@options[:port]}"
end end
def server_stop def server_stop