make sure logging works, more file watcher ignores
This commit is contained in:
parent
d1f0e6f616
commit
2c42cb4930
|
@ -321,8 +321,6 @@ class Middleman::Base
|
|||
@req = Rack::Request.new(env)
|
||||
@res = Rack::Response.new
|
||||
|
||||
puts "== Request: #{env["PATH_INFO"]}" if logging?
|
||||
|
||||
if env["PATH_INFO"] == "/__middleman__" && env["REQUEST_METHOD"] == "POST"
|
||||
if req.params.has_key?("change")
|
||||
self.files.did_change(req.params["change"])
|
||||
|
@ -334,6 +332,8 @@ class Middleman::Base
|
|||
return res.finish
|
||||
end
|
||||
|
||||
puts "== Request: #{env["PATH_INFO"]}" if logging?
|
||||
|
||||
# Catch :halt exceptions and use that response if given
|
||||
catch(:halt) do
|
||||
process_request
|
||||
|
|
|
@ -81,6 +81,7 @@ module Middleman::CoreExtensions::FileWatcher
|
|||
# @param [String] path The file that changed
|
||||
# @return [void]
|
||||
def did_change(path)
|
||||
puts "== File Change: #{path}" if instance.logging? && !::Middleman::Watcher.ignore_list.any? { |r| path.match(r) }
|
||||
self.known_paths << path unless self.known_paths.include?(path)
|
||||
self.run_callbacks(path, :changed)
|
||||
end
|
||||
|
@ -90,6 +91,7 @@ module Middleman::CoreExtensions::FileWatcher
|
|||
# @param [String] path The file that was deleted
|
||||
# @return [void]
|
||||
def did_delete(path)
|
||||
puts "== File Deletion: #{path}" if instance.logging? && !::Middleman::Watcher.ignore_list.any? { |r| path.match(r) }
|
||||
self.known_paths.delete(path) if self.known_paths.include?(path)
|
||||
self.run_callbacks(path, :deleted)
|
||||
end
|
||||
|
|
|
@ -23,7 +23,10 @@ module Middleman
|
|||
[
|
||||
/\.sass-cache/,
|
||||
/\.git/,
|
||||
/\.DS_Store/
|
||||
/\.DS_Store/,
|
||||
/build/,
|
||||
/\.rbenv-version/,
|
||||
/Gemfile/
|
||||
]
|
||||
end
|
||||
end
|
||||
|
@ -76,7 +79,7 @@ module Middleman
|
|||
set :environment, env
|
||||
set :logging, is_logging
|
||||
end
|
||||
$stderr.puts "Is logging?: #{is_logging}"
|
||||
|
||||
app_rack = app.class.to_rack_app
|
||||
|
||||
opts = @options.dup
|
||||
|
|
Loading…
Reference in a new issue