Giter Site home page Giter Site logo

notifies's Introduction

notifies

Simple notifications with Growl and OS X Notification Center.

Gem Version Dependency Status Build Status Coverage Status

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)

notifies's People

Contributors

alphahydrae avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.