Search code examples
ruby-on-railsrspecguardgemfile

Allowing either growl or terminal notifier for guard


Ok currently I can get either the Growl or Terminal Notifier to work with Guard. Whichever one I place in my Gemfile and run bundle with then works.

I need to have some place other than the Gemfile to choose which one to use. I'm working on a project with multiple developers, and most use Growl. I prefer Terminal Notifier.

I don't want to make the changes in the Gemfile because that's in version control.

I can't figure out a way to move this into the Guardfile. Is the next best thing to just do a straight include in the Gemfile and have that be separated out where each developer can edit their .extra-gems file or something? That seems messy.


Solution

  • When you do not configure your notifications, then Guard tries to auto-detect as much notification features as possible. You can make use of the notification method to configure the notifications to your needs. Guard also knows shared configurations, which allows you to have your very own configuration in your home directory.

    You can now set your personal notification settings in ~/.guard.rb:

    notification :terminal_title

    This will disable the auto-detection, enabling only the terminal title notification.