Author: boisvert
Date: Mon Aug 11 15:28:27 2008
New Revision: 684965

URL: http://svn.apache.org/viewvc?rev=684965&view=rev
Log:
Add documentation on Growl, Qube notifications

Modified:
    incubator/buildr/trunk/doc/pages/more_stuff.textile

Modified: incubator/buildr/trunk/doc/pages/more_stuff.textile
URL: 
http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/pages/more_stuff.textile?rev=684965&r1=684964&r2=684965&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/pages/more_stuff.textile (original)
+++ incubator/buildr/trunk/doc/pages/more_stuff.textile Mon Aug 11 15:28:27 2008
@@ -114,6 +114,42 @@
 Be sure to read the nailgun help by executing the @nailgun:help@ task.
 
 
+h2. Growl, Qube
+
+For OS/X users, Buildr supports "Growl":http://growl.info/ out of the box to 
send "completed and "failed" notifications to the user.
+
+For other platforms or if you want to notify the user differently, Buildr 
offers two extension points:
+
+* @Buildr.application.on_completion@
+* @Buildr.application.on_failure@
+
+Here is an example using these extension points to send notifications using 
"Qube":http://launchpad.net/qube:
+
+{{{!ruby
+# Send notifications using Qube 
+notify = lambda do |type, title, message|
+  param = case type
+    when 'completed'
+      '-i'
+    when 'failed'
+      '-e'
+    else
+      '-i'
+  end
+  quote = lambda { |str| return '"' + str + '"' }
+  system exec("qube #{param} #{quote[title]} #{quote[message]}")
+end
+  
+Buildr.application.on_completion do |title, message| 
+  notify['completed', title, message]
+end
+Buildr.application.on_failure do |title, message, ex| 
+  notify['failed', title, message] 
+end
+}}}
+
+You can place this code inside @buildr.rb@ in your home directory.
+
 h2. Eclipse, IDEA
 
 If you're using Eclipse, you can generate @.classpath@ and @.project@ from 
your Buildfile and use them to create a project in your workspace:


Reply via email to