public void StartWatching(IBrowserRefresher refresher) { _refresher = refresher; _watcher = new FileChangeWatcher(_settings.Root, FileSet.Deep("*.*"), this); _watcher.Start(); }
public void StartWatching(string path, ISpecFileObserver observer) { var fullPath = path.ToFullPath(); _watcher = new FileChangeWatcher(fullPath, FileSet.Deep("*.xml"), this); _watcher.Start(); _observer = observer; }
public void Start(OpenInput input) { // You'd think it'd be the other way around if (!input.HotReloadFlag) { _watcher.Start(); } _watcherAssets.Start(); }
public void no_changes() { write("foo.txt", "1"); write("bar.txt", "2"); write("baz.txt", "3"); using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this)) { watcher.Start(); Thread.Sleep(2000); LastChanges.ShouldBeNull(); } }
public void see_adds() { write("foo.txt", "1"); write("bar.txt", "2"); write("baz.txt", "3"); using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this)) { watcher.Start(); write("new.txt", "I am new"); Wait.Until(() => LastChanges != null).ShouldBeTrue(); LastChanges.Added.Single().RelativePath.ShouldBe("new.txt"); } }
public void WatchBinariesAt(string directory) { Console.WriteLine("Watching for binary and config file changes at " + directory); var fileSet = FileSet.Deep("*.dll;*.config;*.exe"); if (Exclude.IsNotEmpty()) { fileSet.Exclude = Exclude; } _watcher = new FileChangeWatcher(directory, fileSet, this) { ChangeBuffer = 500 }; _watcher.Start(); }
public void see_deletes() { write("foo.txt", "1"); write("bar.txt", "2"); write("baz.txt", "3"); using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this)) { watcher.Start(); File.Delete(theDirectory.AppendPath("foo.txt")); File.Delete(theDirectory.AppendPath("baz.txt")); Wait.Until(() => LastChanges != null).ShouldBeTrue(); LastChanges.Deleted.OrderBy(x => x) .ShouldHaveTheSameElementsAs("baz.txt", "foo.txt"); } }
public void see_changes() { write("foo.txt", "1"); write("bar.txt", "2"); write("baz.txt", "3"); using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this)) { watcher.Start(); write("foo.txt", "different"); write("baz.txt", "different"); Wait.Until(() => LastChanges != null).ShouldBeTrue(); LastChanges.Changed.OrderBy(x => x.RelativePath).Select(x => x.RelativePath) .ShouldHaveTheSameElementsAs("baz.txt", "foo.txt"); } }
public void Start() { _watcher.Start(); }
public void StartWatching() { _watcher.Start(); }
public void StartWatching() { _appDomainWatcher.StartWatching(); _watcher.Start(); }
public void Start() { _watcher.Start(); _watcherAssets.Start(); }