Files

Guard::Notifier::GNTP

System notifications using the [ruby_gntp](github.com/snaka/ruby_gntp) gem.

This gem is available for OS X, Linux and Windows and sends system notifications to the following system notification frameworks through the [Growl Network Transport Protocol](www.growlforwindows.com/gfw/help/gntp.aspx):

@example Add the `ruby_gntp` gem to your `Gemfile`

group :development
  gem 'ruby_gntp'
end

@example Add the `:gntp` notifier to your `Guardfile`

notification :gntp

@example Add the `:gntp` notifier with configuration options to your `Guardfile`

notification :gntp, sticky: true, host: '192.168.1.5', password: 'secret'

Constants

CLIENT_DEFAULTS

Default options for the ruby gtnp client.

DEFAULTS

Default options for the ruby gtnp notifications.

Public Class Methods

available?(opts = {}) click to toggle source
# File lib/guard/notifiers/gntp.rb, line 51
def self.available?(opts = {})
  super
  require_gem_safely(opts)
end
gem_name() click to toggle source
# File lib/guard/notifiers/gntp.rb, line 47
def self.gem_name
  'ruby_gntp'
end
supported_hosts() click to toggle source
# File lib/guard/notifiers/gntp.rb, line 43
def self.supported_hosts
  ]darwin linux freebsd openbsd sunos solaris mswin mingw cygwin]
end

Public Instance Methods

notify(message, opts = {}) click to toggle source

Shows a system notification.

@param [String] message the notification message body @param [Hash] opts additional notification library options @option opts [String] type the notification type. Either 'success',

'pending', 'failed' or 'notify'

@option opts [String] title the notification title @option opts [String] image the path to the notification image @option opts [String] host the hostname or IP address to which to send

a remote notification

@option opts [String] password the password used for remote

notifications

@option opts [Integer] port the port to send a remote notification @option opts [Boolean] sticky make the notification sticky

# File lib/guard/notifiers/gntp.rb, line 71
def notify(message, opts = {})
  self.class.require_gem_safely
  normalize_standard_options!(opts)

  opts = DEFAULTS.merge(
    name: opts.delete(:type).to_s,
    text: message,
    icon: opts.delete(:image)
  ).merge(opts)

  _client(opts).notify(opts)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.