qmin 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qmin.rb +6 -4
- data/lib/qmin/reporting/honeybadger.rb +9 -0
- data/lib/qmin/version.rb +1 -1
- data/qmin.gemspec +1 -0
- data/spec/qmin/reporting/honeybadger_spec.rb +45 -0
- data/spec/spec_helper.rb +1 -0
- metadata +18 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d4ccaba214e257c3f7f01236e0ba7b86f48aeff
|
4
|
+
data.tar.gz: 6fd19e28b02615ebc6881d93a176d3db7a001d2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d861272583a4e9c2e008760e46235f6fbe25f58b4ee6f080cba52c17e32f79fed786e8d2cc8a0148e5147a1e59debaf796f48264425d43a66d2a9ede3a1df13b
|
7
|
+
data.tar.gz: 98dcd0024924a5a4ad9e650adbe8d11b8cf8045945070d8c596308ecf1184999da17fdefc55b968d7607e6bf97034b00a60b03e683661a571c10758d0ac0ed7b
|
data/lib/qmin.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
require 'qmin/qmin'
|
2
|
+
|
2
3
|
require 'qmin/core_ext/class'
|
3
4
|
require 'qmin/core_ext/string'
|
5
|
+
|
4
6
|
require 'qmin/strategy/inline'
|
5
7
|
require 'qmin/strategy/noop'
|
6
8
|
|
7
9
|
require 'qmin/reporting/inline'
|
8
10
|
require 'qmin/reporting/noop'
|
9
11
|
|
10
|
-
if defined? Resque
|
12
|
+
if defined? ::Resque
|
11
13
|
require 'qmin/resque/background_call_job'
|
12
14
|
require 'qmin/resque/base_job'
|
13
15
|
require 'qmin/strategy/resque'
|
14
16
|
end
|
15
17
|
|
16
|
-
if defined? Mail
|
17
|
-
|
18
|
-
|
18
|
+
require 'qmin/reporting/mail' if defined? ::Mail
|
19
|
+
require 'qmin/reporting/honeybadger' if defined? ::Honeybadger
|
20
|
+
|
19
21
|
|
20
22
|
module Qmin
|
21
23
|
|
data/lib/qmin/version.rb
CHANGED
data/qmin.gemspec
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path '../../spec_helper', File.dirname(__FILE__)
|
2
|
+
require File.expand_path '../../../lib/qmin', File.dirname(__FILE__)
|
3
|
+
|
4
|
+
describe 'Qmin::Reporting::Honeybadger' do
|
5
|
+
|
6
|
+
before do
|
7
|
+
Qmin::Qmin.default_reporter = Qmin::Reporting::Honeybadger
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:error_producer){ TestClass.new(123) }
|
11
|
+
|
12
|
+
it 'raises error with default inline strategy' do
|
13
|
+
Honeybadger.expects(:notify_or_ignore).with(kind_of(TestClass::CustomError))
|
14
|
+
error_producer.raise_error
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'raises no error with noop strategy' do
|
18
|
+
Qmin::Qmin.default_strategy = Qmin::Strategy::Noop
|
19
|
+
Honeybadger.expects(:notify_or_ignore).never
|
20
|
+
|
21
|
+
lambda{
|
22
|
+
error_producer.raise_error
|
23
|
+
}.should_not raise_error
|
24
|
+
end
|
25
|
+
|
26
|
+
describe 'resque strategy' do
|
27
|
+
before do
|
28
|
+
Qmin::Qmin.default_strategy = Qmin::Strategy::Resque
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'raises no error with resque strategy when enqueueing the job' do
|
32
|
+
lambda{
|
33
|
+
error_producer.raise_error
|
34
|
+
}.should_not raise_error
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'raises error when job is performing' do
|
38
|
+
Honeybadger.expects(:notify_or_ignore).with(kind_of(TestClass::CustomError))
|
39
|
+
|
40
|
+
Qmin::Resque::BackgroundCallJob.new(TestClass, :raise_error, error_producer.id).perform
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- the-architect
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.5.3
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: honeybadger
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: Simple framwork to coordinate background tasks
|
84
98
|
email:
|
85
99
|
- marcel.scherf@epicteams.com
|
@@ -99,6 +113,7 @@ files:
|
|
99
113
|
- lib/qmin/core_ext/class.rb
|
100
114
|
- lib/qmin/core_ext/string.rb
|
101
115
|
- lib/qmin/qmin.rb
|
116
|
+
- lib/qmin/reporting/honeybadger.rb
|
102
117
|
- lib/qmin/reporting/inline.rb
|
103
118
|
- lib/qmin/reporting/mail.rb
|
104
119
|
- lib/qmin/reporting/mail/mail_builder.rb
|
@@ -113,6 +128,7 @@ files:
|
|
113
128
|
- spec/qmin/core_ext/class_spec.rb
|
114
129
|
- spec/qmin/core_ext/string_spec.rb
|
115
130
|
- spec/qmin/qmin_spec.rb
|
131
|
+
- spec/qmin/reporting/honeybadger_spec.rb
|
116
132
|
- spec/qmin/reporting/inline_spec.rb
|
117
133
|
- spec/qmin/reporting/mail/mail_builder_spec.rb
|
118
134
|
- spec/qmin/reporting/mail_spec.rb
|
@@ -150,6 +166,7 @@ test_files:
|
|
150
166
|
- spec/qmin/core_ext/class_spec.rb
|
151
167
|
- spec/qmin/core_ext/string_spec.rb
|
152
168
|
- spec/qmin/qmin_spec.rb
|
169
|
+
- spec/qmin/reporting/honeybadger_spec.rb
|
153
170
|
- spec/qmin/reporting/inline_spec.rb
|
154
171
|
- spec/qmin/reporting/mail/mail_builder_spec.rb
|
155
172
|
- spec/qmin/reporting/mail_spec.rb
|