Comparing version 0.1.3 to 0.2.0
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.6.2 | ||
// Generated by CoffeeScript 1.6.3 | ||
var Beholder, EventEmitter, async, fs, glob, minimatch, path, | ||
@@ -24,4 +24,3 @@ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
function Beholder(pattern, options, cb) { | ||
var _base, _base1, _base2, _base3, _base4, _ref, _ref1, _ref2, _ref3, _ref4; | ||
var _base, _base1, _base2, _base3, _base4; | ||
this.pattern = pattern; | ||
@@ -49,15 +48,15 @@ this.options = options != null ? options : {}; | ||
this.init = true; | ||
if ((_ref = (_base = this.options).interval) == null) { | ||
if ((_base = this.options).interval == null) { | ||
_base.interval = 5007; | ||
} | ||
if ((_ref1 = (_base1 = this.options).persistent) == null) { | ||
if ((_base1 = this.options).persistent == null) { | ||
_base1.persistent = true; | ||
} | ||
if ((_ref2 = (_base2 = this.options).includeHidden) == null) { | ||
if ((_base2 = this.options).includeHidden == null) { | ||
_base2.includeHidden = false; | ||
} | ||
if ((_ref3 = (_base3 = this.options).exclude) == null) { | ||
if ((_base3 = this.options).exclude == null) { | ||
_base3.exclude = []; | ||
} | ||
if ((_ref4 = (_base4 = this.options).debug) == null) { | ||
if ((_base4 = this.options).debug == null) { | ||
_base4.debug = false; | ||
@@ -74,3 +73,2 @@ } | ||
var _this = this; | ||
if (process.platform === 'win32') { | ||
@@ -86,3 +84,2 @@ pattern = pattern.replace(/\\/g, "/"); | ||
var finish; | ||
if (err && cb) { | ||
@@ -108,3 +105,2 @@ return cb(err); | ||
var _this = this; | ||
return fs.stat(base, function(err, stats) { | ||
@@ -118,3 +114,2 @@ if (err) { | ||
var file, filePath, _i, _len; | ||
if (err) { | ||
@@ -140,3 +135,2 @@ return _this.handleError(err); | ||
var _this = this; | ||
return fs.stat(filePath, function(err, stats) { | ||
@@ -162,3 +156,2 @@ if (err) { | ||
var i; | ||
if (this.hiddenPath(dirPath)) { | ||
@@ -169,3 +162,2 @@ return; | ||
var _i, _len, _ref, _results; | ||
_ref = this.dirs; | ||
@@ -189,3 +181,2 @@ _results = []; | ||
var i, _ref; | ||
if (this.invalidFile(filePath)) { | ||
@@ -204,3 +195,2 @@ return; | ||
var _i, _len, _ref1, _results; | ||
_ref1 = this.dirs; | ||
@@ -221,3 +211,2 @@ _results = []; | ||
_this = this; | ||
if ((this.maxFiles != null) && this.files.length >= this.maxFiles) { | ||
@@ -244,3 +233,2 @@ return this.initPoll(watchPath, watchFn); | ||
var _this = this; | ||
return fs.watchFile(path.normalize(watchPath), this.pollOpts, function(curr, prev) { | ||
@@ -261,3 +249,2 @@ if (curr.mtime.getTime() && curr.mtime.getTime() < prev.mtime.getTime()) { | ||
_this = this; | ||
_ref = this.files; | ||
@@ -283,3 +270,3 @@ for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
_this.emit(event, filePath); | ||
_this.removeWatch(filePath, true); | ||
_this.removeWatch(file, true); | ||
_this.addFile(filePath, stats, true); | ||
@@ -294,3 +281,2 @@ file = null; | ||
var i, _ref; | ||
if (((_ref = file.watcher) != null ? _ref.close : void 0) != null) { | ||
@@ -303,3 +289,2 @@ file.watcher.close(); | ||
var _i, _len, _ref1, _results; | ||
_ref1 = this.files; | ||
@@ -317,3 +302,2 @@ _results = []; | ||
var _i, _len, _ref1, _results; | ||
_ref1 = this.dirs; | ||
@@ -333,3 +317,3 @@ _results = []; | ||
if (!silent) { | ||
this.emit('any', file.name); | ||
this.emit('any', file.name, 'remove'); | ||
} | ||
@@ -342,3 +326,2 @@ file.watcher = null; | ||
var file, index, _i, _len, _ref; | ||
_ref = this.files; | ||
@@ -360,3 +343,2 @@ for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) { | ||
var i, _i, _len, _ref; | ||
if (this.hiddenPath(filePath)) { | ||
@@ -367,3 +349,2 @@ return true; | ||
var _i, _len, _ref, _results; | ||
_ref = this.files; | ||
@@ -394,3 +375,2 @@ _results = []; | ||
var pattern, _i, _len, _ref; | ||
_ref = this.patterns; | ||
@@ -423,3 +403,2 @@ for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
var file, i, _i, _j, _len, _len1, _ref, _ref1; | ||
_ref = this.files; | ||
@@ -449,3 +428,2 @@ for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
var file, _i, _len, _ref; | ||
_ref = this.files; | ||
@@ -464,3 +442,2 @@ for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
var i, _i, _len, _ref, _results; | ||
_ref = this.files; | ||
@@ -477,3 +454,2 @@ _results = []; | ||
var i, _i, _len, _ref, _results; | ||
_ref = this.dirs; | ||
@@ -480,0 +456,0 @@ _results = []; |
{ | ||
"name": "beholder", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"author": "Charles Moncrief <cmoncrief@gmail.com>", | ||
@@ -34,3 +34,4 @@ "description": "Robust cross-platform file watcher", | ||
"mocha": "~1.8.1", | ||
"coffee-script": "~1.6.3" | ||
"coffee-script": "~1.6.3", | ||
"mkdirp": "^0.3.5" | ||
}, | ||
@@ -37,0 +38,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26719
3