exception_notification 4.0.0 → 4.0.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.
- data/CHANGELOG.rdoc +8 -0
- data/Gemfile.lock +4 -1
- data/MIT-LICENSE +20 -0
- data/README.md +69 -4
- data/exception_notification.gemspec +6 -2
- data/lib/exception_notifier.rb +4 -2
- data/lib/exception_notifier/hipchat_notifier.rb +34 -0
- data/lib/exception_notifier/views/exception_notifier/_environment.html.erb +0 -8
- data/lib/exception_notifier/views/exception_notifier/_environment.text.erb +0 -3
- data/lib/exception_notifier/views/exception_notifier/_request.html.erb +14 -2
- data/lib/exception_notifier/views/exception_notifier/_request.text.erb +8 -5
- data/lib/exception_notifier/webhook_notifier.rb +22 -0
- data/lib/generators/exception_notification/templates/exception_notification.rb +6 -0
- data/test/dummy/test/functional/posts_controller_test.rb +1 -1
- data/test/exception_notifier/hipchat_notifier_test.rb +75 -0
- data/test/exception_notifier/webhook_notifier_test.rb +21 -0
- data/test/test_helper.rb +6 -2
- metadata +24 -10
data/CHANGELOG.rdoc
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
exception_notification (4.0.
|
4
|
+
exception_notification (4.0.1)
|
5
5
|
actionmailer (>= 3.0.4)
|
6
6
|
activesupport (>= 3.0.4)
|
7
7
|
|
@@ -58,6 +58,8 @@ GEM
|
|
58
58
|
faraday (>= 0.7.4, < 0.9)
|
59
59
|
hashie (1.2.0)
|
60
60
|
hike (1.2.1)
|
61
|
+
hipchat (0.11.0)
|
62
|
+
httparty
|
61
63
|
http_parser.rb (0.5.3)
|
62
64
|
httparty (0.10.2)
|
63
65
|
multi_json (~> 1.0)
|
@@ -155,6 +157,7 @@ DEPENDENCIES
|
|
155
157
|
appraisal
|
156
158
|
coveralls (~> 0.6.5)
|
157
159
|
exception_notification!
|
160
|
+
hipchat (>= 0.11.0)
|
158
161
|
httparty (~> 0.10.2)
|
159
162
|
mocha (>= 0.13.0)
|
160
163
|
rails (>= 3.0.4)
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2005 Jamis Buck
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ Whatever::Application.config.middleware.use ExceptionNotification::Rack,
|
|
47
47
|
}
|
48
48
|
```
|
49
49
|
|
50
|
-
> **Note**: In order delivery notifications by email make sure you have [ActionMailer configured](#actionmailer-configuration).
|
50
|
+
> **Note**: In order to enable delivery notifications by email make sure you have [ActionMailer configured](#actionmailer-configuration).
|
51
51
|
|
52
52
|
|
53
53
|
In order to use ExceptionNotification with Sinatra, please take a look in the [example application](https://github.com/smartinez87/exception_notification/tree/master/examples/sinatra).
|
@@ -75,7 +75,7 @@ Whatever::Application.config.middleware.use ExceptionNotification::Rack,
|
|
75
75
|
}
|
76
76
|
```
|
77
77
|
|
78
|
-
Beside that, the rack
|
78
|
+
Beside that, the rack middleware was renamed to `ExceptionNotification::Rack`.
|
79
79
|
|
80
80
|
## Notifiers
|
81
81
|
|
@@ -195,7 +195,7 @@ Whatever::Application.config.middleware.use ExceptionNotification::Rack,
|
|
195
195
|
|
196
196
|
##### email_headers
|
197
197
|
|
198
|
-
*Hash
|
198
|
+
*Hash of strings, default: {}*
|
199
199
|
|
200
200
|
Additionally, you may want to set customized headers on the outcoming emails. To do so, simply use the `:email_headers` option:
|
201
201
|
|
@@ -258,7 +258,7 @@ Whatever::Application.config.middleware.use ExceptionNotification::Rack,
|
|
258
258
|
:email_prefix => "[Whatever] ",
|
259
259
|
:sender_address => %{"notifier" <notifier@example.com>},
|
260
260
|
:exception_recipients => %w{exceptions@example.com},
|
261
|
-
:delivery_method => :
|
261
|
+
:delivery_method => :smtp,
|
262
262
|
:smtp_settings => {
|
263
263
|
:user_name => "bob",
|
264
264
|
:password => "password",
|
@@ -326,6 +326,67 @@ The API token to allow access to your Campfire account.
|
|
326
326
|
For more options to set Campfire, like _ssl_, check [here](https://github.com/collectiveidea/tinder/blob/master/lib/tinder/campfire.rb#L17).
|
327
327
|
|
328
328
|
|
329
|
+
### HipChat notifier
|
330
|
+
|
331
|
+
This notifier sends notifications to your Hipchat room.
|
332
|
+
|
333
|
+
#### Usage
|
334
|
+
|
335
|
+
Just add the [hipchat](https://github.com/hipchat/hipchat) gem to your `Gemfile`:
|
336
|
+
|
337
|
+
```ruby
|
338
|
+
gem 'hipchat'
|
339
|
+
```
|
340
|
+
|
341
|
+
To configure it, you need to set the `token` and `room_name` options, like this:
|
342
|
+
|
343
|
+
```ruby
|
344
|
+
Whatever::Application.config.middleware.use ExceptionNotification::Rack,
|
345
|
+
:email => {
|
346
|
+
:email_prefix => "[Whatever] ",
|
347
|
+
:sender_address => %{"notifier" <notifier@example.com>},
|
348
|
+
:exception_recipients => %w{exceptions@example.com}
|
349
|
+
},
|
350
|
+
:hipchat => {
|
351
|
+
:api_token => 'my_token',
|
352
|
+
:room_name => 'my_room'
|
353
|
+
}
|
354
|
+
```
|
355
|
+
|
356
|
+
#### Options
|
357
|
+
|
358
|
+
##### room_name
|
359
|
+
|
360
|
+
*String, required*
|
361
|
+
|
362
|
+
The HipChat room where the notifications must be published to.
|
363
|
+
|
364
|
+
##### api_token
|
365
|
+
|
366
|
+
*String, required*
|
367
|
+
|
368
|
+
The API token to allow access to your HipChat account.
|
369
|
+
|
370
|
+
##### announce
|
371
|
+
|
372
|
+
*Boolean, optionnal*
|
373
|
+
|
374
|
+
Notify users. Default : false.
|
375
|
+
|
376
|
+
##### color
|
377
|
+
|
378
|
+
*String, optionnal*
|
379
|
+
|
380
|
+
Color of the message. Default : 'red'.
|
381
|
+
|
382
|
+
##### from
|
383
|
+
|
384
|
+
*String, optionnal*
|
385
|
+
|
386
|
+
Message will appear from this nickname. Default : 'Exception'.
|
387
|
+
|
388
|
+
For all options & possible values see [Hipchat API](https://www.hipchat.com/docs/api/method/rooms/message).
|
389
|
+
|
329
390
|
### Webhook notifier
|
330
391
|
|
331
392
|
This notifier ships notifications over the HTTP protocol.
|
@@ -559,6 +620,10 @@ or
|
|
559
620
|
|
560
621
|
## Versions
|
561
622
|
|
623
|
+
For v4.0.0, see this tag:
|
624
|
+
|
625
|
+
http://github.com/smartinez87/exception_notification/tree/v4.0.0
|
626
|
+
|
562
627
|
For v3.0.1, see this tag:
|
563
628
|
|
564
629
|
http://github.com/smartinez87/exception_notification/tree/v3.0.1
|
@@ -1,13 +1,16 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'exception_notification'
|
3
|
-
s.version = '4.0.
|
3
|
+
s.version = '4.0.1'
|
4
4
|
s.authors = ["Jamis Buck", "Josh Peek"]
|
5
|
-
s.date = %q{2013-
|
5
|
+
s.date = %q{2013-09-15}
|
6
6
|
s.summary = "Exception notification for Rails apps"
|
7
7
|
s.homepage = "http://smartinez87.github.com/exception_notification"
|
8
8
|
s.email = "smartinez87@gmail.com"
|
9
9
|
s.license = "MIT"
|
10
10
|
|
11
|
+
s.required_ruby_version = '>= 1.9.3'
|
12
|
+
s.required_rubygems_version = '>= 1.8.11'
|
13
|
+
|
11
14
|
s.files = `git ls-files`.split("\n")
|
12
15
|
s.test_files = `git ls-files -- test`.split("\n")
|
13
16
|
s.require_path = 'lib'
|
@@ -24,4 +27,5 @@ Gem::Specification.new do |s|
|
|
24
27
|
s.add_development_dependency "sqlite3", ">= 1.3.4"
|
25
28
|
s.add_development_dependency "coveralls", "~> 0.6.5"
|
26
29
|
s.add_development_dependency "appraisal", ">= 0"
|
30
|
+
s.add_development_dependency "hipchat", ">= 0.11.0"
|
27
31
|
end
|
data/lib/exception_notifier.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'logger'
|
2
2
|
require 'active_support/core_ext/string/inflections'
|
3
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
3
4
|
|
4
5
|
module ExceptionNotifier
|
5
6
|
|
6
7
|
autoload :Notifier, 'exception_notifier/notifier'
|
7
8
|
autoload :EmailNotifier, 'exception_notifier/email_notifier'
|
8
9
|
autoload :CampfireNotifier, 'exception_notifier/campfire_notifier'
|
10
|
+
autoload :HipchatNotifier, 'exception_notifier/hipchat_notifier'
|
9
11
|
autoload :WebhookNotifier, 'exception_notifier/webhook_notifier'
|
10
12
|
|
11
13
|
class UndefinedNotifierError < StandardError; end
|
@@ -75,7 +77,7 @@ module ExceptionNotifier
|
|
75
77
|
def ignored?(exception, options)
|
76
78
|
@@ignores.any?{ |condition| condition.call(exception, options) }
|
77
79
|
rescue Exception => e
|
78
|
-
logger.warn "An error occurred when evaluating an ignore condition. #{e.class}: #{e.message}"
|
80
|
+
logger.warn "An error occurred when evaluating an ignore condition. #{e.class}: #{e.message}\n#{e.backtrace.join("\n")}"
|
79
81
|
false
|
80
82
|
end
|
81
83
|
|
@@ -87,7 +89,7 @@ module ExceptionNotifier
|
|
87
89
|
notifier = registered_exception_notifier(notifier_name)
|
88
90
|
notifier.call(exception, options)
|
89
91
|
rescue Exception => e
|
90
|
-
logger.warn "An error occurred when sending a notification using '#{notifier_name}' notifier. #{e.class}: #{e.message}"
|
92
|
+
logger.warn "An error occurred when sending a notification using '#{notifier_name}' notifier. #{e.class}: #{e.message}\n#{e.backtrace.join("\n")}"
|
91
93
|
false
|
92
94
|
end
|
93
95
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module ExceptionNotifier
|
2
|
+
class HipchatNotifier
|
3
|
+
|
4
|
+
attr_accessor :from
|
5
|
+
attr_accessor :room
|
6
|
+
attr_accessor :message_options
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
begin
|
10
|
+
api_token = options.delete(:api_token)
|
11
|
+
room_name = options.delete(:room_name)
|
12
|
+
@from = options.delete(:from) || 'Exception'
|
13
|
+
@room = HipChat::Client.new(api_token)[room_name]
|
14
|
+
@message_options = options
|
15
|
+
@message_options[:color] ||= 'red'
|
16
|
+
rescue
|
17
|
+
@room = nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def call(exception, options={})
|
22
|
+
return if !active?
|
23
|
+
|
24
|
+
message = "A new exception occurred: '#{exception.message}' on '#{exception.backtrace.first}'"
|
25
|
+
@room.send(@from, message, @message_options)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def active?
|
31
|
+
!@room.nil?
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -3,6 +3,10 @@
|
|
3
3
|
<strong>URL:</strong>
|
4
4
|
<span><%= raw @request.url %></span>
|
5
5
|
</li>
|
6
|
+
<li>
|
7
|
+
<strong>HTTP Method:</strong>
|
8
|
+
<span><%= raw @request.request_method %></span>
|
9
|
+
</li>
|
6
10
|
<li>
|
7
11
|
<strong>IP Address:</strong>
|
8
12
|
<span><%= raw @request.remote_ip %></span>
|
@@ -11,6 +15,14 @@
|
|
11
15
|
<strong>Parameters:</strong>
|
12
16
|
<span><%= raw @request.filtered_parameters.inspect %></span>
|
13
17
|
</li>
|
18
|
+
<li>
|
19
|
+
<strong>Timestamp:</strong>
|
20
|
+
<span><%= raw Time.current %></span>
|
21
|
+
</li>
|
22
|
+
<li>
|
23
|
+
<strong>Server:</strong>
|
24
|
+
<span><%= raw Socket.gethostname %></span>
|
25
|
+
</li>
|
14
26
|
<% if defined?(Rails) %>
|
15
27
|
<li>
|
16
28
|
<strong>Rails root:</strong>
|
@@ -18,7 +30,7 @@
|
|
18
30
|
</li>
|
19
31
|
<% end %>
|
20
32
|
<li>
|
21
|
-
<strong>
|
22
|
-
<span><%= raw
|
33
|
+
<strong>Process:</strong>
|
34
|
+
<span><%= raw $$ %></span>
|
23
35
|
</li>
|
24
36
|
</ul>
|
@@ -1,7 +1,10 @@
|
|
1
|
-
* URL
|
2
|
-
*
|
3
|
-
*
|
1
|
+
* URL : <%= raw @request.url %>
|
2
|
+
* HTTP Method: <%= raw @request.request_method %>
|
3
|
+
* IP address : <%= raw @request.remote_ip %>
|
4
|
+
* Parameters : <%= raw @request.filtered_parameters.inspect %>
|
5
|
+
* Timestamp : <%= raw Time.current %>
|
6
|
+
* Server : <%= raw Socket.gethostname %>
|
4
7
|
<% if defined?(Rails) %>
|
5
|
-
* Rails root: <%= raw Rails.root %>
|
8
|
+
* Rails root : <%= raw Rails.root %>
|
6
9
|
<% end %>
|
7
|
-
*
|
10
|
+
* Process: <%= raw $$ %>
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'action_dispatch'
|
2
|
+
|
1
3
|
module ExceptionNotifier
|
2
4
|
class WebhookNotifier
|
3
5
|
|
@@ -6,14 +8,34 @@ module ExceptionNotifier
|
|
6
8
|
end
|
7
9
|
|
8
10
|
def call(exception, options={})
|
11
|
+
env = options[:env]
|
12
|
+
|
9
13
|
options = options.reverse_merge(@default_options)
|
10
14
|
url = options.delete(:url)
|
11
15
|
http_method = options.delete(:http_method) || :post
|
12
16
|
|
13
17
|
options[:body] ||= {}
|
18
|
+
options[:body][:server] = Socket.gethostname
|
19
|
+
options[:body][:process] = $$
|
20
|
+
options[:body][:rails_root] = Rails.root if defined?(Rails)
|
14
21
|
options[:body][:exception] = {:error_class => exception.class.to_s,
|
15
22
|
:message => exception.message.inspect,
|
16
23
|
:backtrace => exception.backtrace}
|
24
|
+
options[:body][:data] = (env['exception_notifier.exception_data'] || {}).merge(options[:data] || {})
|
25
|
+
|
26
|
+
unless env.nil?
|
27
|
+
request = ActionDispatch::Request.new(env)
|
28
|
+
|
29
|
+
request_items = {:url => request.original_url,
|
30
|
+
:http_method => request.http_method,
|
31
|
+
:ip_address => request.remote_ip,
|
32
|
+
:parameters => request.filtered_parameters,
|
33
|
+
:timestamp => Time.current }
|
34
|
+
|
35
|
+
options[:body][:request] = request_items
|
36
|
+
options[:body][:session] = request.session
|
37
|
+
options[:body][:environment] = request.filtered_env
|
38
|
+
end
|
17
39
|
|
18
40
|
HTTParty.send(http_method, url, options)
|
19
41
|
end
|
@@ -38,6 +38,12 @@ ExceptionNotification.configure do |config|
|
|
38
38
|
# :room_name => 'my_room'
|
39
39
|
# }
|
40
40
|
|
41
|
+
# HipChat notifier sends notifications to your HipChat room. Requires 'hipchat' gem.
|
42
|
+
# config.add_notifier :hipchat, {
|
43
|
+
# :api_token => 'my_token',
|
44
|
+
# :room_name => 'my_room'
|
45
|
+
# }
|
46
|
+
|
41
47
|
# Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem.
|
42
48
|
# config.add_notifier :webhook, {
|
43
49
|
# :url => 'http://example.com:5555/hubot/path',
|
@@ -46,7 +46,7 @@ class PostsControllerTest < ActionController::TestCase
|
|
46
46
|
end
|
47
47
|
|
48
48
|
test "mail should contain timestamp of exception in body" do
|
49
|
-
assert @mail.encoded.include? "Timestamp
|
49
|
+
assert @mail.encoded.include? "Timestamp : #{Time.current}"
|
50
50
|
end
|
51
51
|
|
52
52
|
test "mail should contain the newly defined section" do
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'hipchat'
|
3
|
+
|
4
|
+
class HipchatNotifierTest < ActiveSupport::TestCase
|
5
|
+
|
6
|
+
test "should send hipchat notification if properly configured" do
|
7
|
+
options = {
|
8
|
+
:api_token => 'good_token',
|
9
|
+
:room_name => 'room_name',
|
10
|
+
:color => 'yellow',
|
11
|
+
}
|
12
|
+
|
13
|
+
HipChat::Room.any_instance.expects(:send).with('Exception', fake_body, { :color => 'yellow' })
|
14
|
+
|
15
|
+
hipchat = ExceptionNotifier::HipchatNotifier.new(options)
|
16
|
+
hipchat.call(fake_exception)
|
17
|
+
end
|
18
|
+
|
19
|
+
test "should allow custom from value if set" do
|
20
|
+
options = {
|
21
|
+
:api_token => 'good_token',
|
22
|
+
:room_name => 'room_name',
|
23
|
+
:from => 'TrollFace',
|
24
|
+
}
|
25
|
+
|
26
|
+
HipChat::Room.any_instance.expects(:send).with('TrollFace', fake_body, { :color => 'red' })
|
27
|
+
|
28
|
+
hipchat = ExceptionNotifier::HipchatNotifier.new(options)
|
29
|
+
hipchat.call(fake_exception)
|
30
|
+
end
|
31
|
+
|
32
|
+
test "should not send hipchat notification if badly configured" do
|
33
|
+
wrong_params = {
|
34
|
+
:api_token => 'bad_token',
|
35
|
+
:room_name => 'test_room'
|
36
|
+
}
|
37
|
+
|
38
|
+
HipChat::Client.stubs(:new).with('bad_token').returns(nil)
|
39
|
+
|
40
|
+
hipchat = ExceptionNotifier::HipchatNotifier.new(wrong_params)
|
41
|
+
assert_nil hipchat.room
|
42
|
+
end
|
43
|
+
|
44
|
+
test "should not send hipchat notification if api_key is missing" do
|
45
|
+
wrong_params = {:room_name => 'test_room'}
|
46
|
+
|
47
|
+
HipChat::Client.stubs(:new).with(nil).returns(nil)
|
48
|
+
|
49
|
+
hipchat = ExceptionNotifier::HipchatNotifier.new(wrong_params)
|
50
|
+
assert_nil hipchat.room
|
51
|
+
end
|
52
|
+
|
53
|
+
test "should not send hipchat notification if room_name is missing" do
|
54
|
+
wrong_params = {:api_token => 'good_token'}
|
55
|
+
|
56
|
+
HipChat::Client.stubs(:new).with('good_token').returns({})
|
57
|
+
|
58
|
+
hipchat = ExceptionNotifier::HipchatNotifier.new(wrong_params)
|
59
|
+
assert_nil hipchat.room
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
def fake_body
|
65
|
+
"A new exception occurred: '#{fake_exception.message}' on '#{fake_exception.backtrace.first}'"
|
66
|
+
end
|
67
|
+
|
68
|
+
def fake_exception
|
69
|
+
exception = begin
|
70
|
+
5/0
|
71
|
+
rescue Exception => e
|
72
|
+
e
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -14,6 +14,15 @@ class WebhookNotifierTest < ActiveSupport::TestCase
|
|
14
14
|
assert_equal response[:body][:exception][:error_class], "ZeroDivisionError"
|
15
15
|
assert response[:body][:exception][:message].include? "divided by 0"
|
16
16
|
assert response[:body][:exception][:backtrace].include? "/exception_notification/test/webhook_notifier_test.rb:48"
|
17
|
+
|
18
|
+
assert response[:body][:request][:cookies].has_key?(:cookie_item1)
|
19
|
+
assert_equal response[:body][:request][:url], "http://example.com/example"
|
20
|
+
assert_equal response[:body][:request][:ip_address], "192.168.1.1"
|
21
|
+
assert response[:body][:request][:environment].has_key?(:env_item1)
|
22
|
+
assert_equal response[:body][:request][:controller], "#<ControllerName:0x007f9642a04d00>"
|
23
|
+
assert response[:body][:request][:session].has_key?(:session_item1)
|
24
|
+
assert response[:body][:request][:parameters].has_key?(:controller)
|
25
|
+
assert response[:body][:data][:extra_data].has_key?(:data_item1)
|
17
26
|
end
|
18
27
|
|
19
28
|
private
|
@@ -26,6 +35,18 @@ class WebhookNotifierTest < ActiveSupport::TestCase
|
|
26
35
|
:error_class => 'ZeroDivisionError',
|
27
36
|
:message => 'divided by 0',
|
28
37
|
:backtrace => '/exception_notification/test/webhook_notifier_test.rb:48:in `/'
|
38
|
+
},
|
39
|
+
:data => {
|
40
|
+
:extra_data => {:data_item1 => "datavalue1", :data_item2 => "datavalue2"}
|
41
|
+
},
|
42
|
+
:request => {
|
43
|
+
:cookies => {:cookie_item1 => 'cookieitemvalue1', :cookie_item2 => 'cookieitemvalue2'},
|
44
|
+
:url => 'http://example.com/example',
|
45
|
+
:ip_address => '192.168.1.1',
|
46
|
+
:environment => {:env_item1 => "envitem1", :env_item2 => "envitem2"},
|
47
|
+
:controller => '#<ControllerName:0x007f9642a04d00>',
|
48
|
+
:session => {:session_item1 => "sessionitem1", :session_item2 => "sessionitem2"},
|
49
|
+
:parameters => {:action =>"index", :controller =>"projects"}
|
29
50
|
}
|
30
51
|
}
|
31
52
|
}
|
data/test/test_helper.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# Configure Rails Environment
|
2
2
|
ENV["RAILS_ENV"] = "test"
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
begin
|
5
|
+
require "coveralls"
|
6
|
+
Coveralls.wear!
|
7
|
+
rescue LoadError
|
8
|
+
warn "warning: coveralls gem not found; skipping Coveralls"
|
9
|
+
end
|
6
10
|
|
7
11
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
8
12
|
require "rails/test_help"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exception_notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-09-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionmailer
|
@@ -188,6 +188,22 @@ dependencies:
|
|
188
188
|
- - ! '>='
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
|
+
- !ruby/object:Gem::Dependency
|
192
|
+
name: hipchat
|
193
|
+
requirement: !ruby/object:Gem::Requirement
|
194
|
+
none: false
|
195
|
+
requirements:
|
196
|
+
- - ! '>='
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: 0.11.0
|
199
|
+
type: :development
|
200
|
+
prerelease: false
|
201
|
+
version_requirements: !ruby/object:Gem::Requirement
|
202
|
+
none: false
|
203
|
+
requirements:
|
204
|
+
- - ! '>='
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: 0.11.0
|
191
207
|
description:
|
192
208
|
email: smartinez87@gmail.com
|
193
209
|
executables: []
|
@@ -202,6 +218,7 @@ files:
|
|
202
218
|
- CONTRIBUTING.md
|
203
219
|
- Gemfile
|
204
220
|
- Gemfile.lock
|
221
|
+
- MIT-LICENSE
|
205
222
|
- README.md
|
206
223
|
- Rakefile
|
207
224
|
- examples/sinatra/Gemfile
|
@@ -222,6 +239,7 @@ files:
|
|
222
239
|
- lib/exception_notifier.rb
|
223
240
|
- lib/exception_notifier/campfire_notifier.rb
|
224
241
|
- lib/exception_notifier/email_notifier.rb
|
242
|
+
- lib/exception_notifier/hipchat_notifier.rb
|
225
243
|
- lib/exception_notifier/notifier.rb
|
226
244
|
- lib/exception_notifier/views/exception_notifier/_backtrace.html.erb
|
227
245
|
- lib/exception_notifier/views/exception_notifier/_backtrace.text.erb
|
@@ -299,6 +317,7 @@ files:
|
|
299
317
|
- test/dummy/test/test_helper.rb
|
300
318
|
- test/exception_notifier/campfire_notifier_test.rb
|
301
319
|
- test/exception_notifier/email_notifier_test.rb
|
320
|
+
- test/exception_notifier/hipchat_notifier_test.rb
|
302
321
|
- test/exception_notifier/webhook_notifier_test.rb
|
303
322
|
- test/exception_notifier_test.rb
|
304
323
|
- test/test_helper.rb
|
@@ -314,19 +333,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
314
333
|
requirements:
|
315
334
|
- - ! '>='
|
316
335
|
- !ruby/object:Gem::Version
|
317
|
-
version:
|
318
|
-
segments:
|
319
|
-
- 0
|
320
|
-
hash: -2589511577649954983
|
336
|
+
version: 1.9.3
|
321
337
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
322
338
|
none: false
|
323
339
|
requirements:
|
324
340
|
- - ! '>='
|
325
341
|
- !ruby/object:Gem::Version
|
326
|
-
version:
|
327
|
-
segments:
|
328
|
-
- 0
|
329
|
-
hash: -2589511577649954983
|
342
|
+
version: 1.8.11
|
330
343
|
requirements: []
|
331
344
|
rubyforge_project:
|
332
345
|
rubygems_version: 1.8.23
|
@@ -391,6 +404,7 @@ test_files:
|
|
391
404
|
- test/dummy/test/test_helper.rb
|
392
405
|
- test/exception_notifier/campfire_notifier_test.rb
|
393
406
|
- test/exception_notifier/email_notifier_test.rb
|
407
|
+
- test/exception_notifier/hipchat_notifier_test.rb
|
394
408
|
- test/exception_notifier/webhook_notifier_test.rb
|
395
409
|
- test/exception_notifier_test.rb
|
396
410
|
- test/test_helper.rb
|