     @_watch directory, read
 
   _handle: (file) ->
+    return if @invalid.test path.basename file
     fs.realpath file, (error, filePath) =>
       return exports.logError error if error?
       fs.stat file, (error, stats) =>



class exports.Watcher extends EventEmitter
  constructor: ->
    #console.log "Created"
    @watched = {}


# Filter out dotfiles, emacs swap files and directories.
exports.filterFiles = (files, sourcePath) ->
  files.filter (filename) ->
    return no if (exports.Watcher::invalid).test filename
    stats = fs.statSync path.join sourcePath, filename
    return no if stats?.isDirectory()
    yes
