resque-crashlog 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
data/LICENCE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Pat Allan
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.
@@ -0,0 +1,19 @@
1
+ h1. Resque::Failure::CrashLog
2
+
3
+ Use the @crashlog@ gem as you normally would - and just add the following failure backend to your Resque setup. Here's my current setup:
4
+
5
+ <pre><code>require 'resque/failure/multiple'
6
+ require 'resque-crashlog'
7
+
8
+ Resque::Failure::Multiple.classes = [
9
+ Resque::Failure::Redis, Resque::Failure::CrashLog
10
+ ]
11
+ Resque::Failure.backend = Resque::Failure::Multiple</code></pre>
12
+
13
+ h2. Contributing
14
+
15
+ There's really so little code involved here, so I've not bothered with tests. Don't tell anyone. If you want to add them - or contribute in other ways - please fork and offer patches in separate branches.
16
+
17
+ h2. Licence
18
+
19
+ Copyright (c) 2012, resque-crashlog is developed and maintained by Pat Allan, and is released under the open MIT Licence.
@@ -0,0 +1,3 @@
1
+ require 'bundler'
2
+
3
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1 @@
1
+ require 'resque/crashlog'
@@ -0,0 +1,3 @@
1
+ require 'crashlog'
2
+
3
+ require 'resque/failure/crash_log'
@@ -0,0 +1,21 @@
1
+ class Resque::Failure::CrashLog < Resque::Failure::Base
2
+ def self.count
3
+ # No information on this from CrashLog, so we're stealing the approach
4
+ # Airbrake has taken, and just using Resque's own stats.
5
+ Stat[:failed]
6
+ end
7
+
8
+ def save
9
+ CrashLog.notify_or_ignore(exception, :context => crash_log_context)
10
+ end
11
+
12
+ private
13
+
14
+ def crash_log_context
15
+ {
16
+ :queue => queue.to_s,
17
+ :job => payload['class'].to_s,
18
+ :arguments => payload['args']
19
+ }
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # -*- encoding: utf-8 -*-
2
+ Gem::Specification.new do |s|
3
+ s.name = 'resque-crashlog'
4
+ s.version = '0.1.0'
5
+ s.authors = ['Pat Allan']
6
+ s.email = ['pat@freelancing-gods.com']
7
+ s.homepage = 'https://github.com/pat/resque-crashlog'
8
+ s.summary = 'Resque failure handler for crashlog.io'
9
+ s.description = "A handler for Resque's failure backend that will send exceptions through to crashlog.io. Uses your existing CrashLog setup."
10
+ s.require_paths = ['lib']
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+
14
+ s.add_runtime_dependency 'resque', '>= 1.20.0'
15
+ s.add_runtime_dependency 'crashlog', '>= 1.0.1'
16
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resque-crashlog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Pat Allan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: resque
16
+ requirement: &70214941310000 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.20.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70214941310000
25
+ - !ruby/object:Gem::Dependency
26
+ name: crashlog
27
+ requirement: &70214941309540 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.1
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70214941309540
36
+ description: A handler for Resque's failure backend that will send exceptions through
37
+ to crashlog.io. Uses your existing CrashLog setup.
38
+ email:
39
+ - pat@freelancing-gods.com
40
+ executables: []
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - Gemfile
45
+ - LICENCE
46
+ - README.textile
47
+ - Rakefile
48
+ - lib/resque-crashlog.rb
49
+ - lib/resque/crashlog.rb
50
+ - lib/resque/failure/crash_log.rb
51
+ - resque-crashlog.gemspec
52
+ homepage: https://github.com/pat/resque-crashlog
53
+ licenses: []
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 1.8.16
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: Resque failure handler for crashlog.io
76
+ test_files: []
77
+ has_rdoc: