diff --git a/flour.coffee b/flour.coffee index 47a9426..203c274 100644 --- a/flour.coffee +++ b/flour.coffee @@ -1,10 +1,11 @@ -fs = require 'fs' -path = require 'path' -util = require 'util' -domain = require 'domain' -colors = require 'colors' -glob = require 'glob' -queue = require 'queue-async' +fs = require 'fs' +path = require 'path' +util = require 'util' +domain = require 'domain' +colors = require 'colors' +glob = require 'glob' +queue = require 'queue-async' +gaze = require 'gaze' File = require './lib/file' logger = require './lib/logger' @@ -85,7 +86,8 @@ flour = return watch: (file, fn) -> - file.watch fn + logger.log "Watching".green, f for f in [].concat(file) + gaze(file).on('all', fn) noConflict: -> for m in globals @@ -178,7 +180,7 @@ success = (dest, file, output, sourceMap, action, cb) -> # - accept both arrays and *.xxx paths # - capture errors using domains # - feed the original method a File instance -['lint', 'compile', 'minify', 'watch'].forEach (method) -> +['lint', 'compile', 'minify'].forEach (method) -> original = flour[method] diff --git a/lib/file.coffee b/lib/file.coffee index 5b0975b..c9f3eed 100644 --- a/lib/file.coffee +++ b/lib/file.coffee @@ -1,7 +1,7 @@ fs = require 'fs' path = require 'path' domain = require 'domain' -hound = require 'hound' +gaze = require 'gaze' logger = require './logger' @@ -55,9 +55,7 @@ class File watch: (fn) -> fn = fn.bind @ try - @watcher = hound.watch @path - for evt in ['create', 'change', 'delete'] - @watcher.on evt, fn + gaze(@path).on('all', fn) logger.log "Watching".green, @path catch e logger.fail 'watching', @path, e @@ -78,4 +76,4 @@ class File @path -module.exports = File \ No newline at end of file +module.exports = File diff --git a/package.json b/package.json index ae3dd8f..13da21c 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "main": "flour.coffee", "dependencies": { "colors": "*", - "hound": "*", "glob": "*", - "queue-async": "~1" + "queue-async": "~1", + "gaze": "~0.3.4" }, "devDependencies": { "mocha": "*",