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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ba49c07120bd3024f94dae12f439d4b13702929
4
- data.tar.gz: 210ea73ac2f474acea43bc4443755ca3d25a9948
3
+ metadata.gz: 8d4ccaba214e257c3f7f01236e0ba7b86f48aeff
4
+ data.tar.gz: 6fd19e28b02615ebc6881d93a176d3db7a001d2f
5
5
  SHA512:
6
- metadata.gz: 4faca47aab093bd2e56159c72b20cec9fa984c1057af69acaabafa842ba1d99c563643a0c89aea6ca9a86f46daba3d6c4c359b8dabfe692d1e2166ac5dcfa528
7
- data.tar.gz: fd4b8e2d591a34e455a75c0386e2b5429d1baf11b26972ebcfd4879b33417e0f96a95a960db83f7499b03a1d38500dd8c1d0c12cdc113334f9420375ba0dde8d
6
+ metadata.gz: d861272583a4e9c2e008760e46235f6fbe25f58b4ee6f080cba52c17e32f79fed786e8d2cc8a0148e5147a1e59debaf796f48264425d43a66d2a9ede3a1df13b
7
+ data.tar.gz: 98dcd0024924a5a4ad9e650adbe8d11b8cf8045945070d8c596308ecf1184999da17fdefc55b968d7607e6bf97034b00a60b03e683661a571c10758d0ac0ed7b
@@ -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
- require 'qmin/reporting/mail'
18
- end
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
 
@@ -0,0 +1,9 @@
1
+ module Qmin
2
+ module Reporting
3
+ class Honeybadger
4
+ def report(exception)
5
+ ::Honeybadger.notify_or_ignore(exception)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Qmin
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'rspec'
24
24
  spec.add_development_dependency 'mocha'
25
25
  spec.add_development_dependency 'mail', '2.5.3'
26
+ spec.add_development_dependency 'honeybadger'
26
27
  end
@@ -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
+
@@ -8,6 +8,7 @@ rescue LoadError
8
8
  end
9
9
 
10
10
  require 'mail'
11
+ require 'honeybadger'
11
12
  require 'rspec/autorun'
12
13
 
13
14
  Mail.defaults do
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.10
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