Sha256: 10956a3b5eac8d35086341b2e2154f6e028f3a58c596a56433c15e3ed7bc1069

Contents?: true

Size: 985 Bytes

Versions: 62

Compression:

Stored size: 985 Bytes

Contents

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
var path = require("path");

function WatcherManager() {
	this.directoryWatchers = {};
}

WatcherManager.prototype.getDirectoryWatcher = function(directory) {
	var DirectoryWatcher = require("./DirectoryWatcher");
	if(!this.directoryWatchers[directory]) {
		this.directoryWatchers[directory] = new DirectoryWatcher(directory, {});
		this.directoryWatchers[directory].on("closed", function() {
			delete this.directoryWatchers[directory];
		}.bind(this));
	}
	return this.directoryWatchers[directory];
};

WatcherManager.prototype.watchFile = function watchFile(p, startTime) {
	var directory = path.dirname(p);
	return this.getDirectoryWatcher(directory).watch(p, startTime);
};

WatcherManager.prototype.watchDirectory = function watchDirectory(directory, startTime) {
	return this.getDirectoryWatcher(directory).watch(directory, startTime);
};

module.exports = new WatcherManager();

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
smock-0.1.246 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.245 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.244 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.243 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.242 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.241 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.240 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.239 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.2 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.1 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.238 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.237 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.236 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.235 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.234 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.233 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.232 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.231 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.230 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.229 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js