Fork me on GitHub

ruby_gntp by snaka

Ruby library for GNTP(Growl Notification Transport Protocol) client

License

MIT style license

Authors

snaka

Contact

snaka (snaka.gml@gmail.com)

Install

You can install this by gem command like followings.

From RubyForge

$ gem install ruby_gntp

From GitHub

If you first time to install gems via Github, you need add source url by gem command as follows.

 $ gem sources -a http://gems.github.com

then..

  $ gem install snaka-ruby_gntp

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/snaka/ruby_gntp

Usage example

require 'rubygems'
require 'ruby_gntp'

# -- Standard way
growl = GNTP.new("Ruby/GNTP self test")
growl.register(:notifications => [{
  :name     => "notify",
  :enabled  => true,
}])

growl.notify(
  :name  => "notify",
  :title => "Congraturation",
  :text  => "Congraturation! You are successful install ruby_gntp.",
  :icon  => "http://www.hatena.ne.jp/users/sn/snaka72/profile.gif",
  :sticky=> true,
)

# callback
growl.notify( :name => "hotify" ) do |context|
  puts "callback-result: #{context[:callback_result]}"
end

# -- Instant notification
GNTP.notify(
  :app_name => "Instant notify",
  :title    => "Instant notification",
  :text     => "Instant notification available now.",
  :icon     => "http://www.hatena.ne.jp/users/sn/snaka72/profile.gif",
)