make sure logging works, more file watcher ignores

This commit is contained in:
Thomas Reynolds 2012-01-16 15:02:38 -08:00
parent d1f0e6f616
commit 2c42cb4930
3 changed files with 9 additions and 4 deletions

View file

@ -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"])
@ -333,6 +331,8 @@ class Middleman::Base
res.status = 200
return res.finish
end
puts "== Request: #{env["PATH_INFO"]}" if logging?
# Catch :halt exceptions and use that response if given
catch(:halt) do

View file

@ -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

View file

@ -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