Skip to content

Commit

Permalink
drop Growl support
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Mar 24, 2022
1 parent 847028f commit dd6cc19
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 187 deletions.
33 changes: 4 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@
Status](https://secure.travis-ci.org/flyerhzm/uniform_notifier.svg)](http://travis-ci.org/flyerhzm/uniform_notifier)
[![AwesomeCode Status for flyerhzm/uniform_notifier](https://awesomecode.io/projects/3e29a7de-0b37-4ecf-b06d-410ebf815174/status)](https://awesomecode.io/repos/flyerhzm/uniform_notifier)

uniform_notifier is extracted from [bullet][0], it gives you the ability to send notification through rails logger, customized logger, javascript alert, javascript console, growl, xmpp, airbrake, honeybadger and AppSignal.
uniform_notifier is extracted from [bullet][0], it gives you the ability to send notification through rails logger, customized logger, javascript alert, javascript console, xmpp, airbrake, honeybadger and AppSignal.

## Install

### install directly

gem install uniform_notifier

if you want to notify by growl < v1.3, you should install ruby-growl first

gem install ruby-growl

if you want to notify by growl v1.3+, you should install ruby_gntp first

gem install ruby_gntp

if you want to notify by xmpp, you should install xmpp4r first

gem install xmpp4r
Expand Down Expand Up @@ -56,13 +48,13 @@ if you want to notify by terminal-notifier, you must install it first

gem "uniform_notifier"

you should add ruby-growl, ruby_gntp, xmpp4r, airbrake, bugsnag, honeybadger, slack-notifier, terminal-notifier gem if you want.
you should add xmpp4r, airbrake, bugsnag, honeybadger, slack-notifier, terminal-notifier gem if you want.

## Usage

There are two types of notifications,
one is <code>inline_notify</code>, for javascript alert and javascript console notifiers, which returns a string and will be combined,
the other is <code>out_of_channel_notify</code>, for rails logger, customized logger, growl and xmpp, which doesn't return anything, just send the message to the notifiers.
the other is <code>out_of_channel_notify</code>, for rails logger, customized logger, xmpp, which doesn't return anything, just send the message to the notifiers.

By default, all notifiers are disabled, you should enable them first.

Expand Down Expand Up @@ -120,11 +112,6 @@ logger = File.open('notify.log', 'a+')
logger.sync = true
UniformNotifier.customized_logger = logger

# growl without password
UniformNotifier.growl = true
# growl with passowrd
UniformNotifier.growl = { :password => 'growl password' }

# xmpp
UniformNotifier.xmpp = { :account => 'sender_account@jabber.org',
:password => 'password_for_jabber',
Expand All @@ -146,7 +133,7 @@ UniformNotifier.raise = false # don't raise errors
After that, you can enjoy the notifiers, that's cool!

```ruby
# the notify message will be notified to rails logger, customized logger, growl or xmpp.
# the notify message will be notified to rails logger, customized logger or xmpp.
UniformNotifier.active_notifiers.each do |notifier|
notifier.out_of_channel_notify("customize message")
end
Expand All @@ -161,18 +148,6 @@ end
javascript_str = responses.join("\n")
```

## Growl Support

To get Growl support up-and-running, follow the steps below:

* For Growl < v1.3, install the ruby-growl gem: <code>gem install ruby-growl</code>
* For Growl v1.3+, install the ruby_gntp gem: <code>gem install ruby_gntp</code>
* Open the Growl preference pane in Systems Preferences
* Click the "Network" tab
* Make sure both "Listen for incoming notifications" and "Allow remote application registration" are checked. *Note*: If you set a password, you will need to set <code>UniformNotifier.growl_password = { :password => 'growl password' }</code> in the config file.
* Restart Growl ("General" tab -> Stop Growl -> Start Growl)
* Boot up your application. UniformNotifier will automatically send a Growl notification when Growl is turned on. If you do not see it when your application loads, make sure it is enabled in your initializer and double-check the steps above.

## XMPP/Jabber Support

To get XMPP support up-and-running, follow the steps below:
Expand Down
8 changes: 0 additions & 8 deletions lib/uniform_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require 'uniform_notifier/errors'
require 'uniform_notifier/javascript_alert'
require 'uniform_notifier/javascript_console'
require 'uniform_notifier/growl'
require 'uniform_notifier/honeybadger'
require 'uniform_notifier/xmpp'
require 'uniform_notifier/rails_logger'
Expand All @@ -22,7 +21,6 @@ class UniformNotifier
AVAILABLE_NOTIFIERS = %i[
alert
console
growl
honeybadger
xmpp
rails_logger
Expand All @@ -40,7 +38,6 @@ class UniformNotifier
NOTIFIERS = [
JavascriptAlert,
JavascriptConsole,
Growl,
HoneybadgerNotifier,
Xmpp,
RailsLogger,
Expand All @@ -65,11 +62,6 @@ def active_notifiers
NOTIFIERS.select(&:active?)
end

undef growl=
def growl=(growl)
UniformNotifier::Growl.setup_connection(growl)
end

undef xmpp=
def xmpp=(xmpp)
UniformNotifier::Xmpp.setup_connection(xmpp)
Expand Down
76 changes: 0 additions & 76 deletions lib/uniform_notifier/growl.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'uniform_notifier'
require 'ruby-growl'
require 'xmpp4r'
require 'slack-notifier'
require 'rspec'
69 changes: 0 additions & 69 deletions spec/uniform_notifier/growl_spec.rb

This file was deleted.

6 changes: 2 additions & 4 deletions uniform_notifier.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ Gem::Specification.new do |s|
s.authors = ['Richard Huang']
s.email = ['flyerhzm@gmail.com']
s.homepage = 'http://rubygems.org/gems/uniform_notifier'
s.summary = 'uniform notifier for rails logger, customized logger, javascript alert, javascript console, growl and xmpp'
s.description = 'uniform notifier for rails logger, customized logger, javascript alert, javascript console, growl and xmpp'
s.summary = 'uniform notifier for rails logger, customized logger, javascript alert, javascript console and xmpp'
s.description = 'uniform notifier for rails logger, customized logger, javascript alert, javascript console and xmpp'
s.license = 'MIT'

s.required_ruby_version = '>= 2.3'

s.add_development_dependency 'rspec', ['> 0']
s.add_development_dependency 'ruby_gntp', ['= 0.3.4']
s.add_development_dependency 'ruby-growl', ['= 4.0']
s.add_development_dependency 'slack-notifier', ['>= 1.0']
s.add_development_dependency 'xmpp4r', ['= 0.5']

Expand Down

0 comments on commit dd6cc19

Please sign in to comment.