Skip to content

Commit

Permalink
replace hound with gaze module, fixes ricardobeat#27
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobeat committed Jun 29, 2013
1 parent bad3403 commit 3357b21
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 11 additions & 9 deletions flour.coffee
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand Down
8 changes: 3 additions & 5 deletions lib/file.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fs = require 'fs'
path = require 'path'
domain = require 'domain'
hound = require 'hound'
gaze = require 'gaze'

logger = require './logger'

Expand Down Expand Up @@ -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
Expand All @@ -78,4 +76,4 @@ class File
@path


module.exports = File
module.exports = File
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"main": "flour.coffee",
"dependencies": {
"colors": "*",
"hound": "*",
"glob": "*",
"queue-async": "~1"
"queue-async": "~1",
"gaze": "~0.3.4"
},
"devDependencies": {
"mocha": "*",
Expand Down

0 comments on commit 3357b21

Please sign in to comment.