GrowlNotifier 1.0.1

Growl Notifier 1.0.1 has been released.

http://rubyforge.org/projects/growlnotifier/
http://growlnotifier.rubyforge.org/

Growl Notifier allows your application to post Growl notifications.
It can then receive clicked and timed out notifications from Growl.
Or you can give it a block, which will then be used as a clicked
callback.

It is an extraction and clean up of the Growl code from LimeChat.
The option to pass procs is extracted from WebApp.

LimeChat:
GitHub - psychs/limechat: IRC Client for Mac

WebApp:
GitHub - alloy/webapp-app: A SSB OSX application, which at some point will be able to create a new application which wraps a specific web application, (Think Campfire, Twitter etc) and allows the user to use Ruby to create event handlers to be able support things like Growl or whatever you would like.

== Installation

gem install growlnotifier

== Requirements

  • Mac OS X 10.4 or 10.5
  • Ruby 1.8
  • RubyCocoa 0.13.1

== Example

require ‘rubygems’
require ‘growl’

class GrowlController < OSX::NSObject
HELLO_TYPE = ‘Hello message received’

def init
if super_init
@g = Growl::Notifier.sharedInstance
@g.delegate = self
@g.register(‘GrowlSample’, [HELLO_TYPE])
@g.notify(HELLO_TYPE, ‘Sticky’, ‘Hello world’,
:sticky => true, :click_context => Time.now.to_s )
@g.notify(HELLO_TYPE, ‘Timed out’, ‘Hello world’,
:click_context => Time.now.to_s )
@count = 2
self
end
end

def growlNotifierClicked_context(sender, context)
puts “Clicked: #{context}”
checkCount
end

def growlNotifierTimedOut_context(sender, context)
puts “Timed out: #{context}”
checkCount
end

def checkCount
@count -= 1
OSX::NSApp.terminate(nil) if @count == 0
end
end

g = GrowlController.alloc.init
OSX::NSApp.run

On Aug 20, 2008, at 3:55 AM, Satoshi N. wrote:

It is an extraction and clean up of the Growl code from LimeChat.
The option to pass procs is extracted from WebApp.

How does this compare to meow ?

http://rubyforge.org/projects/meow

Blessings,
TwP

How does this compare to meow ?

http://rubyforge.org/projects/meow

Hi Tim,

At some point we decided we wanted to extract this code as a separate
lib and gem.
During this process we discovered the Meow lib. But after studying the
source, at that point in time, we decided to go ahead anyway. Because
our code was more mature and with better test coverage etc.

We have however not compared them at this point in time, so if you do
please let us know :slight_smile:

Cheers,
Eloy