qu-exceptional 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,37 @@
1
+ require 'exceptional'
2
+
3
+ module Qu
4
+ module Failure
5
+ class Exceptional
6
+ def self.create(job, exception)
7
+ if ::Exceptional::Config.should_send_to_api?
8
+ ::Exceptional::Remote.error(ExceptionData.new(job, exception))
9
+ end
10
+ end
11
+
12
+ class ExceptionData < ::Exceptional::ExceptionData
13
+ def initialize(job, exception)
14
+ @job = job
15
+ super(exception)
16
+ end
17
+
18
+ def extra_stuff
19
+ {
20
+ 'request' => {
21
+ 'parameters' => {
22
+ 'id' => @job.id,
23
+ 'queue' => @job.queue,
24
+ 'args' => @job.args,
25
+ 'class' => @job.klass.to_s
26
+ }
27
+ },
28
+
29
+ 'rescue_block' => {
30
+ 'name' => @job.klass.to_s
31
+ }
32
+ }
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,4 @@
1
+ require 'qu'
2
+ require 'qu/failure/exceptional'
3
+
4
+ Qu.failure = Qu::Failure::Exceptional
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: qu-exceptional
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Brandon Keepers
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-09-23 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: exceptional
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: qu
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - "="
42
+ - !ruby/object:Gem::Version
43
+ hash: 27
44
+ segments:
45
+ - 0
46
+ - 1
47
+ - 0
48
+ version: 0.1.0
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ description: Exceptional failure backend for qu
52
+ email:
53
+ - brandon@opensoul.org
54
+ executables: []
55
+
56
+ extensions: []
57
+
58
+ extra_rdoc_files: []
59
+
60
+ files:
61
+ - lib/qu-exceptional.rb
62
+ - lib/qu/failure/exceptional.rb
63
+ has_rdoc: true
64
+ homepage: http://github.com/bkeepers/qu
65
+ licenses: []
66
+
67
+ post_install_message:
68
+ rdoc_options: []
69
+
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ requirements: []
91
+
92
+ rubyforge_project:
93
+ rubygems_version: 1.6.1
94
+ signing_key:
95
+ specification_version: 3
96
+ summary: Exceptional failure backend for qu
97
+ test_files: []
98
+