uniform_notifier 1.12.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f27b211c1e550787b74d7a57a1f534fda78a5271
4
- data.tar.gz: 052c8e0d80a431a89c71d5578c0603fd5609686f
3
+ metadata.gz: 2277163be0ebc305f1d6b19d7fa21cfcd001495f
4
+ data.tar.gz: 936dd7c4dca648ed7455e31fee864300c5b451c5
5
5
  SHA512:
6
- metadata.gz: 925e6cf2f2dfc20a84fef57e1bee9872d5ddb18396142b63e335f9db5fe275650a3def097a6a2688e7411ffe2dd980be1313b5271e577514193f9faf0f2f071b
7
- data.tar.gz: 2056c09e18698a84e87f4c8029fea3c73643c7ded92af0f30a40c79edb58b02721a88517012183ebf76f1f6f829150307e3e594151c234fb9e2a438b1feb9eab
6
+ metadata.gz: aed28aa21ea0317abeb16cdd224b07a59e2d236324de028eea148184e6fa2225885c39816a84a61be3b0245e4be1d8db464599fe8203d253ff36dbd820c591c7
7
+ data.tar.gz: d9356571f31ccbc28ab7fd7fef5f27e7e7dc2783faf6cbb1888cc7e3ce9e20d60dfe212324d429a9119c6143cd1752a40b82b325fc37788f1bdf50890040b527
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
3
+ - 2.3.6
@@ -1,5 +1,9 @@
1
1
  # Next Release
2
2
 
3
+ ## 1.12.1
4
+
5
+ * Require Ruby 2.3+
6
+
3
7
  ## 1.12.0 (08/17/2018)
4
8
 
5
9
  * Add [terminal-notifier](https://github.com/julienXX/terminal-notifier) support
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build
4
4
  Status](https://secure.travis-ci.org/flyerhzm/uniform_notifier.png)](http://travis-ci.org/flyerhzm/uniform_notifier)
5
- [![AwesomeCode Status for flyerhzm/uniform_notifier](https://awesomecode.io/projects/3e29a7de-0b37-4ecf-b06d-410ebf815174/status)](https://awesomecode.io/projects/32)
5
+ [![AwesomeCode Status for flyerhzm/uniform_notifier](https://awesomecode.io/projects/3e29a7de-0b37-4ecf-b06d-410ebf815174/status)](https://awesomecode.io/repos/flyerhzm/uniform_notifier)
6
6
 
7
7
  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 and honeybadger.
8
8
 
@@ -62,89 +62,93 @@ the other is <code>out_of_channel_notify</code>, for rails logger, customized lo
62
62
 
63
63
  By default, all notifiers are disabled, you should enable them first.
64
64
 
65
- # javascript alert
66
- UniformNotifier.alert = true
67
- # javascript alert with options
68
- # the attributes key adds custom attributes to the script tag appended to the body
69
- UniformNotifier.alert = { :attributes => { :nonce => 'mySecret-nonce', 'data-key' => 'value' } }
70
-
71
- # javascript console (Safari/Webkit browsers or Firefox w/Firebug installed)
72
- UniformNotifier.console = true
73
- # javascript console with options
74
- # the attributes key adds custom attributes to the script tag appended to the body
75
- UniformNotifier.console = { :attributes => { :nonce => 'mySecret-nonce', 'data-key' => 'value' } }
76
-
77
- # rails logger
78
- UniformNotifier.rails_logger = true
79
-
80
- # airbrake
81
- UniformNotifier.airbrake = true
82
- # airbrake with options
83
- UniformNotifier.airbrake = { :error_class => Exception }
84
-
85
- # Honeybadger
86
- #
87
- # Reporting live data from development is disabled by default. Ensure
88
- # that the `report_data` option is enabled via configuration.
89
- UniformNotifier.honeybadger = true
90
- # Honeybadger with options
91
- UniformNotifier.honeybadger = { :error_class => 'Exception' }
92
-
93
- # rollbar
94
- UniformNotifier.rollbar = true
95
-
96
- # bugsnag
97
- UniformNotifier.bugsnag = true
98
- # bugsnag with options
99
- UniformNotifier.bugsnag = { :api_key => 'something' }
100
-
101
- # slack
102
- UniformNotifier.slack = true
103
- # slack with options
104
- UniformNotifier.slack = { :webhook_url => 'http://some.slack.url', :channel => '#default', :username => 'notifier' }
105
-
106
- # customized logger
107
- logger = File.open('notify.log', 'a+')
108
- logger.sync = true
109
- UniformNotifier.customized_logger = logger
110
-
111
- # growl without password
112
- UniformNotifier.growl = true
113
- # growl with passowrd
114
- UniformNotifier.growl = { :password => 'growl password' }
115
-
116
- # xmpp
117
- UniformNotifier.xmpp = { :account => 'sender_account@jabber.org',
118
- :password => 'password_for_jabber',
119
- :receiver => 'recipient_account@jabber.org',
120
- :show_online_status => true }
121
-
122
- # terminal-notifier
123
- UniformNotifier.terminal_notifier = true
124
-
125
- # raise an error
126
- UniformNotifier.raise = true # raise a generic exception
127
-
128
- class MyExceptionClass < Exception; end
129
- UniformNotifier.raise = MyExceptionClass # raise a custom exception type
130
-
131
- UniformNotifier.raise = false # don't raise errors
65
+ ```ruby
66
+ # javascript alert
67
+ UniformNotifier.alert = true
68
+ # javascript alert with options
69
+ # the attributes key adds custom attributes to the script tag appended to the body
70
+ UniformNotifier.alert = { :attributes => { :nonce => 'mySecret-nonce', 'data-key' => 'value' } }
71
+
72
+ # javascript console (Safari/Webkit browsers or Firefox w/Firebug installed)
73
+ UniformNotifier.console = true
74
+ # javascript console with options
75
+ # the attributes key adds custom attributes to the script tag appended to the body
76
+ UniformNotifier.console = { :attributes => { :nonce => 'mySecret-nonce', 'data-key' => 'value' } }
77
+
78
+ # rails logger
79
+ UniformNotifier.rails_logger = true
80
+
81
+ # airbrake
82
+ UniformNotifier.airbrake = true
83
+ # airbrake with options
84
+ UniformNotifier.airbrake = { :error_class => Exception }
85
+
86
+ # Honeybadger
87
+ #
88
+ # Reporting live data from development is disabled by default. Ensure
89
+ # that the `report_data` option is enabled via configuration.
90
+ UniformNotifier.honeybadger = true
91
+ # Honeybadger with options
92
+ UniformNotifier.honeybadger = { :error_class => 'Exception' }
93
+
94
+ # rollbar
95
+ UniformNotifier.rollbar = true
96
+
97
+ # bugsnag
98
+ UniformNotifier.bugsnag = true
99
+ # bugsnag with options
100
+ UniformNotifier.bugsnag = { :api_key => 'something' }
101
+
102
+ # slack
103
+ UniformNotifier.slack = true
104
+ # slack with options
105
+ UniformNotifier.slack = { :webhook_url => 'http://some.slack.url', :channel => '#default', :username => 'notifier' }
106
+
107
+ # customized logger
108
+ logger = File.open('notify.log', 'a+')
109
+ logger.sync = true
110
+ UniformNotifier.customized_logger = logger
111
+
112
+ # growl without password
113
+ UniformNotifier.growl = true
114
+ # growl with passowrd
115
+ UniformNotifier.growl = { :password => 'growl password' }
116
+
117
+ # xmpp
118
+ UniformNotifier.xmpp = { :account => 'sender_account@jabber.org',
119
+ :password => 'password_for_jabber',
120
+ :receiver => 'recipient_account@jabber.org',
121
+ :show_online_status => true }
122
+
123
+ # terminal-notifier
124
+ UniformNotifier.terminal_notifier = true
125
+
126
+ # raise an error
127
+ UniformNotifier.raise = true # raise a generic exception
128
+
129
+ class MyExceptionClass < Exception; end
130
+ UniformNotifier.raise = MyExceptionClass # raise a custom exception type
131
+
132
+ UniformNotifier.raise = false # don't raise errors
133
+ ```
132
134
 
133
135
  After that, you can enjoy the notifiers, that's cool!
134
136
 
135
- # the notify message will be notified to rails logger, customized logger, growl or xmpp.
136
- UniformNotifier.active_notifiers.each do |notifier|
137
- notifier.out_of_channel_notify("customize message")
138
- end
139
-
140
- # the notify message will be wrapped by <script type="text/javascript">...</script>,
141
- # you should append the javascript_str at the bottom of http response body.
142
- # for more information, please check https://github.com/flyerhzm/bullet/blob/master/lib/bullet/rack.rb
143
- responses = []
144
- UniformNotifier.active_notifiers.each do |notifier|
145
- responses << notifier.inline_notify("customize message")
146
- end
147
- javascript_str = responses.join("\n")
137
+ ```ruby
138
+ # the notify message will be notified to rails logger, customized logger, growl or xmpp.
139
+ UniformNotifier.active_notifiers.each do |notifier|
140
+ notifier.out_of_channel_notify("customize message")
141
+ end
142
+
143
+ # the notify message will be wrapped by <script type="text/javascript">...</script>,
144
+ # you should append the javascript_str at the bottom of http response body.
145
+ # for more information, please check https://github.com/flyerhzm/bullet/blob/master/lib/bullet/rack.rb
146
+ responses = []
147
+ UniformNotifier.active_notifiers.each do |notifier|
148
+ responses << notifier.inline_notify("customize message")
149
+ end
150
+ javascript_str = responses.join("\n")
151
+ ```
148
152
 
149
153
  ## Growl Support
150
154
 
@@ -10,9 +10,7 @@ class UniformNotifier
10
10
 
11
11
  def self._out_of_channel_notify(data)
12
12
  opt = {}
13
- if UniformNotifier.bugsnag.is_a?(Hash)
14
- opt = UniformNotifier.bugsnag
15
- end
13
+ opt = UniformNotifier.bugsnag if UniformNotifier.bugsnag.is_a?(Hash)
16
14
 
17
15
  exception = Exception.new(data[:title])
18
16
  exception.set_backtrace(data[:backtrace]) if data[:backtrace]
@@ -12,9 +12,7 @@ class UniformNotifier
12
12
  message = data.values.compact.join("\n")
13
13
 
14
14
  opt = {}
15
- if UniformNotifier.sentry.is_a?(Hash)
16
- opt = UniformNotifier.sentry
17
- end
15
+ opt = UniformNotifier.sentry if UniformNotifier.sentry.is_a?(Hash)
18
16
 
19
17
  exception = Exception.new(message)
20
18
  Raven.capture_exception(exception, opt)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class UniformNotifier
4
- VERSION = '1.12.0'
4
+ VERSION = '1.12.1'
5
5
  end
@@ -16,6 +16,8 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.rubyforge_project = 'uniform_notifier'
18
18
 
19
+ s.required_ruby_version = '>= 2.3'
20
+
19
21
  s.add_development_dependency 'ruby-growl', ['= 4.0']
20
22
  s.add_development_dependency 'ruby_gntp', ['= 0.3.4']
21
23
  s.add_development_dependency 'xmpp4r', ['= 0.5']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniform_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-17 00:00:00.000000000 Z
11
+ date: 2018-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-growl
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '2.3'
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - ">="