Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up issue #52 and issue #53 pulls.

I also fixed a number of other small issues that I noticed while going
through the code base. Primarily fixing keymappings for Linux and
Windows.
  • Loading branch information...
commit a41a1b969b7786ff3977210f004f0f53efaf579b 1 parent 54abb3e
@cyphactor authored
View
6 Default (Linux).sublime-keymap
@@ -1,4 +1,4 @@
[
- { "keys": ["super+shfit+s"], "command": "gotospec" },
- { "keys": ["ctrl+shift+g"], "command": "run_tests_and_show_output_guard" }
-]
+ { "keys": ["super+shift+c"], "command": "show_guard" },
+ { "keys": ["ctrl+shift+g"], "command": "run_all_tests_and_show_guard" }
+]
View
7 Default (OSX).sublime-keymap
@@ -1,5 +1,4 @@
[
- {
- "keys": ["super+shift+c"], "command": "show_guard"
- }
-]
+ { "keys": ["super+shift+c"], "command": "show_guard" },
+ { "keys": ["ctrl+shift+g"], "command": "run_all_tests_and_show_guard" }
+]
View
7 Default (Windows).sublime-keymap
@@ -1,5 +1,4 @@
[
- {
- "keys": ["super+shit+c"], "command": "go_to_spec"
- }
-]
+ { "keys": ["super+shift+c"], "command": "show_guard" },
+ { "keys": ["ctrl+shift+g"], "command": "run_all_tests_and_show_guard" }
+]
View
3  Default.sublime-commands
@@ -4,8 +4,9 @@
{ "caption": "Guard: Show Guard Output", "command": "show_guard" },
{ "caption": "Guard: Hide Guard Output", "command": "hide_guard" },
{ "caption": "Guard: Run all Tests", "command": "run_all_tests_guard" },
+ { "caption": "Guard: Run all Tests & Show Guard Output", "command": "run_all_tests_and_show_guard" },
{ "caption": "Guard: Output Help", "command": "output_help_guard" },
{ "caption": "Guard: Reload Guard", "command": "run_all_tests_guard" },
{ "caption": "Guard: Toggle Notifications", "command": "toggle_notifications_guard" },
{ "caption": "Guard: Pause/Unpause", "command": "pause_guard" }
-]
+]
View
18 README.markdown
@@ -30,6 +30,7 @@ comes in from the Guard process.
* Stop Guard
* Run all Tests
+ * Run all Tests & Show Guard Output (**does NOT enable auto show**) (**ctrl+shift+g**)
* Reload Guard
* Toggle Notifications
* Pause/Unpause
@@ -81,6 +82,13 @@ the bottom of the screen and show the output of Guard as it runs.
The Guard output can be shown and hidden using the "Show Guard Output" and "Hide Guard Output" command respectively.
The "Show Guard Output" command is also available via the default key binding (**super+shift+c**).
+### Run all Tests & Show Guard Output
+
+Some users prefer a workflow in which the guard pane is hidden the majority of the time and it is just shown when they
+run all the tests. For those users we have the "Run all Tests & Show Guard Output" command. This command shows the guard
+output similar to the "Show Guard Output" command except this command does NOT enable auto show. This command is available
+as always via the command pallete, but also via the key binding (**ctrl+shift+g**).
+
### Other Useful Commands
A few of my favorites commands are "Run all Tests", "Reload Guard", and "Pause/Unpause". The
@@ -97,6 +105,14 @@ load that .rvmrc and attempt to run Guard on that project.
In the case where it can't find RVM it simply tries to run Guard assuming it is installed as a system gem.
+## rbenv Support
+
+This plugin supports *rbenv* out of the box. This means it checks to see if `$HOME/.rbenv` exists and appropriately
+modifies the `PATH` environment variable to include `$HOME/.rbenv/bin` in the path. It also runs `rbenv init -` for
+you.
+
+In the case where it can't find *rbenv* it simply tries to run Guard assuming it is installed as a system gem.
+
## FAQs
#### Does the Guard process die/exit when Sublime Text 2 dies/exits?
@@ -129,4 +145,4 @@ All feature requests or change requests should be made via the [Issues](http://g
As with all of my Open Source Projects I am open to contributions. There are numerous ways one can contribute.
1. **Contribute Code/Documentation** - If you would like to contribute code or documentation changes please fork the repository and submit a pull request.
-2. **Feature Requests/Bug Reports** - If you would like to contribute by submitting either a feature request or a bug report you may do so via the [Issues](http://github.com/cyphactor/sublime_guard/issues) tab.
+2. **Feature Requests/Bug Reports** - If you would like to contribute by submitting either a feature request or a bug report you may do so via the [Issues](http://github.com/cyphactor/sublime_guard/issues) tab.
View
19 guard.py
@@ -70,7 +70,7 @@ def start_guard(self):
cmd_array = [package_path + "/Guard/guard_wrapper", package_path + "/Guard/run_guard.sh", project_root_path]
self.proc = subprocess.Popen(cmd_array, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
self.running = True
- self.show_guard_view()
+ self.show_guard_view_and_enable_autoshow()
if self.proc.stdout:
thread.start_new_thread(self.read_stdout, ())
if self.proc.stderr:
@@ -130,8 +130,11 @@ def scroll_to_end_of_guard_view(self):
(cur_row, _) = self.output_view.rowcol(self.output_view.size())
self.output_view.show(self.output_view.text_point(cur_row, 0))
- def show_guard_view(self):
+ def show_guard_view_and_enable_autoshow(self):
self.enable_auto_show()
+ self.show_guard_view()
+
+ def show_guard_view(self):
self.listener.window.run_command('show_panel', {'panel': 'output.guard'})
def hide_guard_view(self):
@@ -154,10 +157,6 @@ def run_all_tests(self):
self.proc.stdin.write('\n')
self.proc.stdin.flush()
- def run_tests_and_show_output(self):
- self.listener.window.run_command('show_panel', {'panel': 'output.guard'})
- self.run_all_tests()
-
def output_help(self):
self.proc.stdin.write('h\n')
self.proc.stdin.flush()
@@ -217,7 +216,7 @@ def is_enabled(self):
class ShowGuardCommand(sublime_plugin.WindowCommand):
def run(self):
- GuardControllerSingleton().set_listener(self).show_guard_view()
+ GuardControllerSingleton().set_listener(self).show_guard_view_and_enable_autoshow()
def is_enabled(self):
return True
@@ -241,10 +240,12 @@ def is_enabled(self):
return GuardControllerSingleton().is_guard_running()
-class RunTestsAndShowOutputGuardCommand(sublime_plugin.WindowCommand):
+class RunAllTestsAndShowGuardCommand(sublime_plugin.WindowCommand):
def run(self):
- GuardControllerSingleton().set_listener(self).run_tests_and_show_output()
+ GuardControllerSingleton().set_listener(self).show_guard_view()
+ GuardControllerSingleton().set_listener(self).run_all_tests()
+
def is_enabled(self):
return GuardControllerSingleton().is_guard_running()
Please sign in to comment.
Something went wrong with that request. Please try again.