Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

File notifier #407

Merged
merged 4 commits into from Mar 27, 2013

Conversation

Projects
None yet
3 participants
Contributor

amiel commented Mar 27, 2013

Option to write Guard notifications to a file. Each notification will overwrite the file. This allows other commands to be run based on the status of other guard commands.

I tried hard not to say "meta-guard" in the README.

Please see this relevant discussion: https://groups.google.com/forum/?fromgroups=#!topic/guard-dev/wz5zlLJUEQA.

One thing to note. I wanted to disable the notifier when no path option is provided. Right now that happens in .notify as .available? doesn't have access to the notification options.
Since this is still an internal api, it seems like it could still be possible to change .available?(silent = false) to .available?(options = {}, silent = false). Thoughts?

amiel added some commits Mar 27, 2013

@amiel amiel Add FileNotifier
FileNotifier writes guard notification results to a file. This allows
users to handle notifications in a more custom way (think guard-shell).
7d25f11
@amiel amiel Document FileNotifier c411665
@amiel amiel Ruby 1.8 hash syntax 5487374
@amiel amiel Add changelog entry 71cbe93

@netzpirat netzpirat merged commit 71cbe93 into guard:master Mar 27, 2013

Contributor

netzpirat commented Mar 27, 2013

That's a very, very nice pull request that opens a whole bunch of new possibilities. Thanks a lot. I see no problems with adding the options hash to the available? method, but I'd add it as last parameter, so the API is backward compatible: .available?(silent = false, options = {})

Contributor

amiel commented Mar 27, 2013

@netzpirat cool, thanks! I'll tackle the available? change in a separate pull-request.

Owner

rymai commented Mar 28, 2013

This is awesome, thank you Amiel!

Contributor

amiel commented Mar 28, 2013

@rymai I'm glad I could help.

For more on how I'm using it: https://gist.github.com/amiel/5258723

For some reason, my guard-shell doesn't seem to run after the first test run (I'm pretty sure the notification is firing and writing to the file though), but it does fire after every subsequent run.

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