notifies
Simple notifications with Growl and OS X Notification Center.
Installation
In your Gemfile:
gem 'notifies', '~> 0.1.0'
Manually:
gem install notifies
Usage
It's as simple as:
Notifies.notify 'Hello World!'
This will automatically select and use the first available notifier.
The method returns:
-
true
if everything worked; -
nil
if no notifier is available on your system; -
false
if the notifier failed.
Notification Options
The following options are available:
-
:type
- The type of notification. With some notifiers this changes the icon. This must be either:ok
,:info
,:warning
or:error
. By default,:info
is selected. -
:title
- The title of the notification. This is set by the notifier by default (e.g. "growlnotify" for the Growl notifier). -
:subtitle
- An optional subtitle. -
:icon
- Custom icon. Only supported with Growl, see the documentation.
Notifies.notify 'Hello World!', type: :ok, title: 'My App', subtitle: 'Notifications'
Aliases
You can uses these aliases instead of passing the :type
option:
Notifies.notify_ok 'It works!'
Notifies.notify_info 'Useful information'
Notifies.notify_warning 'Beware'
Notifies.notify_error 'Broken'
Contributing
- Fork
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create a pull request from your branch
Please add a changelog entry for new features and bug fixes. Writing specs will get your code pulled faster.
Meta
- Author: Simon Oulevay (Alpha Hydrae)
- License: MIT (see LICENSE.txt)