delayed_job_honeybadger 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 85950afa4d916ad57b890095c9772367bbf7b4e7
4
+ data.tar.gz: 7945f4814bb60cc55843a2a473a78c47d2b1d8f4
5
+ SHA512:
6
+ metadata.gz: f3f799c3b7eba4ddfda1cb58cb988895cb9c15dc93f51a5edf84b1d6e0f11ed12de69ece3518c3633dbe680654763900b76437852ef05980923fc8136dd63816
7
+ data.tar.gz: d47c59534b1b2eebbc618026f236094048c7a8b81a743462685ed22800c5873dfe48717df97449b66768b04caf3c8455aa15c3a1d310d13e45c6d9a454b2e47b
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Honeybadger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,19 @@
1
+ Delayed Job Honeyabdger
2
+ -----------------------
3
+
4
+ Notify Honeybadger of errors in Delayed Job workers.
5
+
6
+ Adapted from [this](http://stackoverflow.com/a/14172132/1332687) and
7
+ [this](https://gist.github.com/2223758)
8
+
9
+ ## Contributing
10
+
11
+ 1. Fork it.
12
+ 2. Create a topic branch `git checkout -b my_branch`
13
+ 3. Commit your changes `git commit -am "Boom"`
14
+ 3. Push to your branch `git push origin my_branch`
15
+ 4. Send a [pull request](https://github.com/honeybadger-io/delayed_job_honeybadger/pulls)
16
+
17
+ ## Todo
18
+
19
+ Add RSpec and write some tests
@@ -0,0 +1,25 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'delayed_job_honeybadger'
3
+ s.version = '0.0.1'
4
+ s.date = '2013-07-22'
5
+
6
+ s.summary = "Honeybadger plugin for Delayed Job"
7
+ s.description = "Notifies Honeybadger of errors in Delayed Job workers."
8
+
9
+ s.authors = ["Joshua Wood"]
10
+ s.email = 'josh@honeybadger.io'
11
+ s.homepage = 'https://github.com/honeybadger-io/delayed_job_honeybadger'
12
+
13
+ s.require_paths = %w[lib]
14
+
15
+ s.add_dependency('honeybadger')
16
+ s.add_dependency('delayed_job')
17
+
18
+ s.files = %w[
19
+ delayed_job_honeybadger.gemspec
20
+ LICENSE
21
+ README.md
22
+ lib/delayed_job_honeybadger.rb
23
+ lib/delayed/plugins/honeybadger.rb
24
+ ]
25
+ end
@@ -0,0 +1,31 @@
1
+ # Notify Honeybadger of errors in DelayedJob workers
2
+ # in /config/initializers/
3
+ #
4
+ # modified
5
+
6
+ module Delayed
7
+ module Plugins
8
+ class Honeybadger < Plugin
9
+ module Notify
10
+ def error(job, error)
11
+ ::Honeybadger.notify_or_ignore(
12
+ :error_class => error.class.name,
13
+ :error_message => "#{ error.class.name }: #{ error.message }",
14
+ :context => {
15
+ :failed_job => job.inspect,
16
+ }
17
+ )
18
+ super if defined?(super)
19
+ end
20
+ end
21
+
22
+ callbacks do |lifecycle|
23
+ lifecycle.before(:invoke_job) do |job|
24
+ payload = job.payload_object
25
+ payload = payload.object if payload.is_a? Delayed::PerformableMethod
26
+ payload.extend Notify
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,6 @@
1
+ require 'delayed_job'
2
+ require 'honeybadger'
3
+
4
+ require 'delayed/plugins/honeybadger'
5
+
6
+ Delayed::Worker.plugins << Delayed::Plugins::Honeybadger
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: delayed_job_honeybadger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Joshua Wood
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: honeybadger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: delayed_job
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Notifies Honeybadger of errors in Delayed Job workers.
42
+ email: josh@honeybadger.io
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - delayed_job_honeybadger.gemspec
48
+ - LICENSE
49
+ - README.md
50
+ - lib/delayed_job_honeybadger.rb
51
+ - lib/delayed/plugins/honeybadger.rb
52
+ homepage: https://github.com/honeybadger-io/delayed_job_honeybadger
53
+ licenses: []
54
+ metadata: {}
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ requirements: []
70
+ rubyforge_project:
71
+ rubygems_version: 2.0.0
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Honeybadger plugin for Delayed Job
75
+ test_files: []