resque_exception_notification 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/MIT-LICENSE +20 -0
- data/README.md +18 -0
- data/lib/resque/failure/exception_notification.rb +28 -0
- data/lib/resque_exception_notification/version.rb +3 -0
- metadata +68 -0
data/Gemfile
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 AKSHAY RAWAT
|
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
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Using the [exception_notification](https://github.com/smartinez87/exception_notification) gem in Rails to send exception emails ? This gem provides a Resque failure backend to report Resque errors via exception notification emails.
|
2
|
+
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
* Add the gem to your Gemfile.
|
7
|
+
|
8
|
+
gem "resque_exception_notification"
|
9
|
+
|
10
|
+
|
11
|
+
* Configure the gem in `config/initializers/resque.rb`
|
12
|
+
|
13
|
+
require "resque/failure/multiple"
|
14
|
+
require "resque/failure/redis"
|
15
|
+
require "resque/failure/exception_notification"
|
16
|
+
|
17
|
+
Resque::Failure::Multiple.classes = [ Resque::Failure::Redis, Resque::Failure::ExceptionNotification ]
|
18
|
+
Resque::Failure.backend = Resque::Failure::Multiple
|
@@ -0,0 +1,28 @@
|
|
1
|
+
begin
|
2
|
+
require "exception_notification"
|
3
|
+
rescue LoadError
|
4
|
+
raise "Can't find 'exception_notification' gem. Please add it to your Gemfile or install it."
|
5
|
+
end
|
6
|
+
|
7
|
+
module Resque
|
8
|
+
module Failure
|
9
|
+
class ExceptionNotification < Base
|
10
|
+
|
11
|
+
def self.count
|
12
|
+
Stat[:failed]
|
13
|
+
end
|
14
|
+
|
15
|
+
def save
|
16
|
+
message = {
|
17
|
+
:worker => worker.to_s,
|
18
|
+
:queue => queue.to_s,
|
19
|
+
:job => payload['class'].to_s,
|
20
|
+
:args => payload['args'].inspect
|
21
|
+
}
|
22
|
+
|
23
|
+
ExceptionNotifier::Notifier.background_exception_notification(exception, :data => message).deliver
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: resque_exception_notification
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Akshay
|
9
|
+
- Rawat
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2013-03-16 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: exception_notification
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '3.0'
|
31
|
+
description: Use exception_notification to send resque exception emails
|
32
|
+
email:
|
33
|
+
- ! '"projects@akshay.cc'
|
34
|
+
executables: []
|
35
|
+
extensions: []
|
36
|
+
extra_rdoc_files: []
|
37
|
+
files:
|
38
|
+
- lib/resque/failure/exception_notification.rb
|
39
|
+
- lib/resque_exception_notification/version.rb
|
40
|
+
- MIT-LICENSE
|
41
|
+
- Gemfile
|
42
|
+
- README.md
|
43
|
+
homepage: https://github.com/akshayrawat/resque_exception_notification
|
44
|
+
licenses: []
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 1.8.23
|
64
|
+
signing_key:
|
65
|
+
specification_version: 3
|
66
|
+
summary: Send Resque exceptions via exception_notification
|
67
|
+
test_files: []
|
68
|
+
has_rdoc:
|