cyphactor/sublime_guard — pull request #48 by diogomafra (2012-06-30 20:01:08+00:00)
Title: Clear the output window when a predefined text is found.

Hi Andrew. First of all, thank you for this great plugin!

I'm using RSpec with Guard, and every time a file is updated, the corresponding specs are executed. Right now, all the output is appended in the output window, but I would like to clear this window every time RSpec is executed.

I made a change that allows the user to define a text (regex) that, when found, clears the output window.

Some examples of the defined text:
* "Running: .*_spec.rb"
* "Running: .*_spec.rb|Failures:"
* "Running: .*_spec.rb|Failures:|Reloading Spork for RSpec"

How to use
-----------------

The user must create a json file called "Guard.sublime-settings" in the user config directory ("Packages/User/"). This file has this format:
```json
{
"clear_when_find_this_text": "Running: .*_spec.rb"
}
```
The text must be a regular expression. Its possible to use "|" (OR) to find more than one text.

Limitations
----------------

I'm loading the settings every time a guard command is executed. If the user change the settings, a guard command must be executed to reload it. It's possible to load the settings inside the _append_data_ method, but I don't know if there is some performance issue with slow computers.