Skip to content
This repository

Pause giles #28 #29

Merged
merged 1 commit into from about 1 year ago

2 participants

Kelly Elton Jeff Schumacher
Kelly Elton

This will allow the user to press P to pause, or unpause Giles.

Kelly Elton

@codereflection From the other pull requests it looks like you fell off the face of the earth?

Jeff Schumacher

You could say that. Big project at work sucking up all my time. I'm merging in your pull request now, and thank you!!

Jeff Schumacher codereflection merged commit 48b3577 into from
Jeff Schumacher codereflection closed this
Kelly Elton

Haha, well good luck, know how that goes, and thanks as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 29, 2013
Kelly Elton Closes #28 - Adds pausing to Giles. 75b1fc6
This page is out of date. Refresh to see the latest.
3  src/Giles.Core/Watchers/SourceWatcher.cs
@@ -21,6 +21,7 @@ public class SourceWatcher : IDisposable
21 21
         readonly GilesConfig config;
22 22
 
23 23
         public List<FileSystemWatcher> FileWatchers { get; set; }
  24
+        public bool Pause { get; set; }
24 25
 
25 26
         public SourceWatcher(IBuildRunner buildRunner, IFileSystem fileSystem,
26 27
                              IFileWatcherFactory fileWatcherFactory, GilesConfig config)
@@ -84,7 +85,7 @@ void ResetBuildTimer()
84 85
 
85 86
         public void RunNow()
86 87
         {
87  
-            if (!buildRunner.Run())
  88
+            if (Pause || !buildRunner.Run())
88 89
                 return;
89 90
 
90 91
             var listener = GetListener.Invoke(config);
12  src/Giles/Program.cs
@@ -134,7 +134,7 @@ static void ConsoleSetup()
134 134
 
135 135
         static InteractiveMenuOption[] GetInteractiveMenuOptions()
136 136
         {
137  
-            return new[]
  137
+			return new[]
138 138
                   {
139 139
                       new InteractiveMenuOption { HandlesKey = key => key == "?", Task = DisplayInteractiveMenuOptions },
140 140
                       new InteractiveMenuOption { HandlesKey = key => key == "i", Task = DisplayConfig },
@@ -146,6 +146,7 @@ static InteractiveMenuOption[] GetInteractiveMenuOptions()
146 146
                       new InteractiveMenuOption { HandlesKey = key => key == "e", Task = DisplayErrors },
147 147
                       new InteractiveMenuOption { HandlesKey = key => key == "f", Task = SetTestFilters },
148 148
                       new InteractiveMenuOption { HandlesKey = key => key == "h", Task = ClearTestFilters },
  149
+					  new InteractiveMenuOption {HandlesKey = key => key == "p", Task = TogglePause},
149 150
                   };
150 151
         }
151 152
 
@@ -209,8 +210,14 @@ static void DisplayVerboseResults()
209 210
                 Console.WriteLine("Please run some tests first...");
210 211
         }
211 212
 
  213
+        static void TogglePause()
  214
+        {
  215
+            sourceWatcher.Pause = sourceWatcher.Pause != true;
  216
+            Console.WriteLine(sourceWatcher.Pause ? "Pausing Giles" : "Resuming Giles");
  217
+        }
  218
+
212 219
 
213  
-        static T GetUserValue<T>(string description, T defaultValue)
  220
+	    static T GetUserValue<T>(string description, T defaultValue)
214 221
         {
215 222
             Console.Write("Enter new value for {0} ({1}): ", description, defaultValue);
216 223
             var newValue = Console.ReadLine();
@@ -259,6 +266,7 @@ static void DisplayInteractiveMenuOptions()
259 266
             Console.WriteLine("   F = Set Test Filters");
260 267
             Console.WriteLine("   H = Clear Test Filters");
261 268
             Console.WriteLine("   Q = Quit");
  269
+            Console.WriteLine("   P = Toggle Pause Giles");
262 270
             Console.WriteLine();
263 271
         }
264 272
     }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.