Closed nanodeath closed 11 years ago
Hi,
i tried to fix that for me: https://github.com/joergschiller/guard-rake/commit/b641e6283805e428cbe58fa96402e7570fccb9b7
Greetings Joerg
I can reproduce the same behaviour. Any exception (a failing test for example) is enough to cause guard-rake to be kicked off the list of active guards.
@joergschiller: Your patched version works well for me. Would you mind creating a pull request for the official repo?
This should be fixed now in v0.0.8
Guard::Rake works pretty well, but it chokes on exceptions. Some of the actions in my Rakefile include shelling out to the LESS compiler (for example) and throwing an exception if there's an error compiling the file. This is necessary to fail the regular non-Guarded build. However, Guard (and/or Guard::Rake) doesn't like unhandled exceptions and basically dies. Ideally, I would just get the error/warning in the console, make the fix and save, and things would just go again. Instead, I have to not throw exceptions (or catch them instead, myself), push messages into a buffer, and then check in my main target to see if any exceptions occurred, and exit if not in Guard mode. Pretty hacky. So I guess what I'm looking for is a code change in guard-rake to swallow exceptions (if possible) and/or guidance on how I should write my Rakefile to deal with the aforementioned scenario.
Thanks!