commit
67ceb47952
|
@ -16,7 +16,8 @@ module Middleman
|
|||
/^\.rbenv-.*$/,
|
||||
/^Gemfile$/,
|
||||
/^Gemfile\.lock$/,
|
||||
/~$/
|
||||
/~$/,
|
||||
/(^|\/)\.?#/
|
||||
]
|
||||
|
||||
# Setup extension
|
||||
|
@ -160,4 +161,4 @@ module Middleman
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require "webrick"
|
||||
|
||||
module Middleman
|
||||
|
||||
WINDOWS = !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i) unless const_defined?(:WINDOWS)
|
||||
|
@ -11,8 +13,6 @@ module Middleman
|
|||
# Start an instance of Middleman::Application
|
||||
# @return [void]
|
||||
def start(options={})
|
||||
require "webrick"
|
||||
|
||||
app = ::Middleman::Application.server.inst do
|
||||
if options[:environment]
|
||||
set :environment, options[:environment].to_sym
|
||||
|
@ -140,8 +140,10 @@ module Middleman
|
|||
:AccessLog => []
|
||||
}
|
||||
|
||||
unless is_logging
|
||||
http_opts[:Logger] = ::WEBrick::Log::new(nil, 0)
|
||||
if is_logging
|
||||
http_opts[:Logger] = FilteredWebrickLog.new
|
||||
else
|
||||
http_opts[:Logger] = ::WEBrick::Log.new(nil, 0)
|
||||
end
|
||||
|
||||
::WEBrick::HTTPServer.new(http_opts)
|
||||
|
@ -171,5 +173,13 @@ module Middleman
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
class FilteredWebrickLog < ::WEBrick::Log
|
||||
def log(level, data)
|
||||
unless data =~ %r{Could not determine content-length of response body.}
|
||||
super(level, data)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -84,7 +84,7 @@ module Middleman
|
|||
paths.flatten!
|
||||
paths.map! { |p| Pathname(p) }
|
||||
files = paths.select { |p| p.file? }
|
||||
(paths - files).each do |dir|
|
||||
paths.select {|p| p.directory? }.each do |dir|
|
||||
files << all_files_under(dir.children)
|
||||
end
|
||||
files.flatten
|
||||
|
|
Loading…
Reference in a new issue