Is there a way to add Growl notifications to the end of all Rake tasks?
I initially thought of creating a task that Growls, and adding it as a dependency to tasks I want alerts from, but realized the dependencies get run before the task begins. Is there a way to add tasks to be run after certain Rake tasks are finished?
It'd be really useful so I don't have to sit there waiting for long tasks.
** update 8/17/2010 **
Here is the solution for doing it with growlnotify...put this in your Rakefile:
def growl(message) growlnotify = `which growlnotify`.chomp system %(#{growlnotify} -sm #{message}) end task_names = Rake.application.top_level_tasks task_names.each do |name| Rake.application[name].enhance { growl "'Task #{name} completed (#{Time.now})'" } end
-- Credit to Alkaline - see his solution for using ruby-growl below --