public
Description: A ruby library which allows you to send Growl notifications. Extracted from LimeChat.
Homepage: http://rubyforge.org/projects/growlnotifier/
Clone URL: git://github.com/psychs/growlnotifier.git
Click here to lend your support to: growlnotifier and make a donation at www.pledgie.com !
psychs (author)
Thu Nov 20 13:01:19 -0800 2008
commit  ced0e72b7b2a10be1a01d1909e331779146b5a88
tree    9e3235bc16ed1aeb364cf4c29aa4ef8d287ed1f4
parent  4323279367737d584e85dc7531f3c9c0300e9996
name age message
file .gitignore Mon Jul 28 02:45:13 -0700 2008 Let the user specify the priority with a symbol... [alloy]
file History.txt Sun Aug 03 08:13:07 -0700 2008 Configured for Hoe, which should make it easy t... [alloy]
file LICENSE Sat Jul 26 08:54:02 -0700 2008 Created README, LICENSE and TODO and include th... [alloy]
file Manifest.txt Sun Aug 03 08:13:07 -0700 2008 Configured for Hoe, which should make it easy t... [alloy]
file README.txt Mon Aug 04 07:24:18 -0700 2008 Updated to assume rubygems. [psychs]
file Rakefile Mon Aug 04 07:13:58 -0700 2008 Changed project name for How. [psychs]
file TODO Sat Jul 26 08:54:02 -0700 2008 Created README, LICENSE and TODO and include th... [alloy]
file init.rb Sat Sep 13 06:44:49 -0700 2008 Added Rucola plugin init.rb file. [alloy]
directory lib/ Thu Nov 20 13:01:19 -0800 2008 version 1.0.2 [psychs]
directory samples/ Mon Aug 04 07:21:31 -0700 2008 Samples should assume rubygems. [psychs]
directory test/ Thu Nov 20 12:59:29 -0800 2008 callback with context=nil when always_callback=... [psychs]
README.txt
= Growl Notifier

== Overview

Growl::Notifier is a class that allows your application to post notifications to the Growl daemon.
It can also receive clicked and timeout notifications as well as take blocks for clicked callback handlers.

This is an extraction and cleanup of the Growl code from LimeChat (http://github.com/psychs/limechat/tree/master) and 
later on extended for WebApp (http://github.com/alloy/webapp-app/tree/master).

== Requirements

* Mac OS X 10.4 or 10.5
* Ruby 1.8 (http://ruby-lang.org/)
* RubyCocoa (http://rubycocoa.sourceforge.net/)

== How to use Growl Notifier

A simple example:

  require 'growl'
  
  g = Growl::Notifier.sharedInstance
  g.register('test_app', ['message_type'])
  g.notify('message_type', 'title', 'desc')

How to receive clicked and timeout notifications in your application:

  require 'rubygems'
  require 'growl'

  class GrowlController < OSX::NSObject
    def init
      if super_init
        @g = Growl::Notifier.sharedInstance
        @g.delegate = self
        @g.register('test_app', ['message_type'])
        @g.notify('message_type', 'title', 'desc')
        self
      end
    end

    def growlNotifierClicked_context(sender, context)
      puts context
    end

    def growlNotifierTimedOut_context(sender, context)
      puts context
    end
  end

Include the Growl module into your class to get access to a few convenience methods:

  require 'rubygems'
  require 'growl'

  class GrowlController < OSX::NSObject
    include Growl
    Growl::Notifier.sharedInstance.register('test_app', ['message_type'])
    
    def init
      if super_init
        growl('message_type', 'title', 'desc')
        self
      end
    end
  end

== License

Copyright (c) 2007-2008 Satoshi Nakagawa <psychs@limechat.net>, Eloy Duran <e.duran@superalloy.nl>
You can redistribute it and/or modify it under the same terms as Ruby.