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.268 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.267 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.266 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.265 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.264 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.263 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.262 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.261 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.260 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.259 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.258 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.256 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.255 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.254 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.253 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.252 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.251 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.250 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.249 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js
smock-0.1.247 node_modules/webpack/node_modules/watchpack/lib/watcherManager.js