resque-honeybadger 0.2.0

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.
data/HISTORY.md ADDED
@@ -0,0 +1,20 @@
1
+ ## Hacked shit up to work with Honeybadger
2
+
3
+ * renamed to resque-honeybadger
4
+
5
+ ## 0.2.0 (2012-09-07)
6
+
7
+ * Changed API URL to: api.exceptional.io
8
+ * Changed test framework to MiniTest.
9
+ * Added Gemfile.
10
+ * Replaced usage of `#to_json` with `MultiJson.dump()`
11
+
12
+ ## 0.1.0 (2010-10-16)
13
+
14
+ * Added more unit tests.
15
+ * Added yardoc code comments.
16
+ * Had a couple days production testing ;-) Initial version to be announced.
17
+
18
+ ## 0.0.1 (2010-10-13)
19
+
20
+ * Initial release.
data/LICENSE ADDED
@@ -0,0 +1,43 @@
1
+ Copyright (c) 2012 Jacques Crocker
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.
21
+
22
+
23
+
24
+ Copyright (c) 2010 Luke Antins
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining
27
+ a copy of this software and associated documentation files (the
28
+ Software), to deal in the Software without restriction, including
29
+ without limitation the rights to use, copy, modify, merge, publish,
30
+ distribute, sublicense, and/or sell copies of the Software, and to
31
+ permit persons to whom the Software is furnished to do so, subject to
32
+ the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be
35
+ included in all copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
38
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
39
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
41
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
42
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
43
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,80 @@
1
+ resque-honeybadger
2
+ ==================
3
+
4
+ resque-honeybadger provides a [Resque][re] failure backend that sends exceptions
5
+ raised by jobs to [honeybadger.io][hb]
6
+
7
+ Install & Quick Start
8
+ ---------------------
9
+
10
+ Before you jump into code, you'll need a honeybadger.io account.
11
+
12
+ To install:
13
+
14
+ $ gem install resque-honeybadger
15
+
16
+ ### Example: Single Failure Backend
17
+
18
+ Using only the honeybadger failure backend:
19
+
20
+ require 'resque'
21
+ require 'resque-honeybadger'
22
+
23
+ Resque::Failure::Honeybadger.configure do |config|
24
+ config.api_key = '505f2518c41866bb0be7ba434bb2b079'
25
+ end
26
+
27
+ Resque::Failure.backend = Resque::Failure::Honeybadger
28
+
29
+ ### Example: Multiple Failure Backends
30
+
31
+ Using both the redis and honeybadger failure backends:
32
+
33
+ require 'resque'
34
+ require 'resque-honeybadger'
35
+
36
+ require 'resque/failure/multiple'
37
+ require 'resque/failure/redis'
38
+
39
+ Resque::Failure::Honeybadger.configure do |config|
40
+ config.api_key = '505f2518c41866bb0be7ba434bb2b079'
41
+ end
42
+
43
+ Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Honeybadger]
44
+ Resque::Failure.backend = Resque::Failure::Multiple
45
+
46
+ Configuration Options
47
+ ---------------------
48
+
49
+ **Required**
50
+
51
+ * `api_key` - your honeybadger.io api key.
52
+
53
+
54
+ Note on Patches/Pull Requests
55
+ -----------------------------
56
+
57
+ * Fork the project.
58
+ * Make your feature addition or bug fix.
59
+ * Add tests for it. This is important so I don't break it in a future
60
+ version unintentionally.
61
+ * Commit, do not mess with the version. (if you want to have your own
62
+ version, that is fine but bump version in a commit by itself I can ignore
63
+ when I pull)
64
+ * Send me a pull request. Bonus points for topic branches.
65
+
66
+
67
+ Forked by
68
+ ------
69
+
70
+ Jacques Crocker :: <http://railsjedi.com> :: @railsjedi
71
+
72
+
73
+ Original Author
74
+ ------
75
+
76
+ Luke Antins :: [http://lividpenguin.com][lp] :: @lantins
77
+
78
+ [re]: http://github.com/defunkt/resque
79
+ [lp]: http://lividpenguin.com
80
+ [hb]: http://honeybadger.io
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.unshift 'lib'
2
+
3
+ require 'rake/testtask'
4
+ require 'fileutils'
5
+ require 'yard'
6
+ require 'yard/rake/yardoc_task'
7
+ require 'bundler/gem_tasks'
8
+
9
+ task :default => :test
10
+
11
+ ##
12
+ # Test task.
13
+ Rake::TestTask.new(:test) do |task|
14
+ task.libs << 'test'
15
+ task.test_files = FileList['test/*_test.rb']
16
+ task.verbose = true
17
+ end
18
+
19
+ ##
20
+ # docs task.
21
+ YARD::Rake::YardocTask.new :yardoc do |t|
22
+ t.files = ['lib/**/*.rb']
23
+ t.options = ['--output-dir', 'doc/',
24
+ '--files', 'LICENSE HISTORY.md',
25
+ '--readme', 'README.md',
26
+ '--title', 'resque-honeybadger documentation']
27
+ end
@@ -0,0 +1,34 @@
1
+ module Resque
2
+ module Failure
3
+ # A Resque failure backend that sends exception data to honeybadger.io
4
+ class Honeybadger < Base
5
+
6
+ # Configures the failure backend. At a minimum you will need to set
7
+ # an api_key.
8
+ #
9
+ # @example Setting your API Key and enabling SSL:
10
+ # Resque::Failure::Honeybadger.configure do |config|
11
+ # config.api_key = '505f2518c41866bb0be7ba434bb2b079'
12
+ # end
13
+ def self.configure(&block)
14
+ ::Honeybadger.configure(&block)
15
+ end
16
+
17
+ def count
18
+ # We can't get the total # of errors from Hoptoad so we fake it
19
+ # by asking Resque how many errors it has seen.
20
+ Stat[:failed]
21
+ end
22
+
23
+ def save
24
+ ::Honeybadger.notify_or_ignore(exception,
25
+ :parameters => {
26
+ :payload_class => payload['class'].to_s,
27
+ :payload_args => payload['args'].inspect
28
+ }
29
+ )
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,4 @@
1
+ require 'resque'
2
+ require 'honeybadger'
3
+
4
+ require 'resque/failure/honeybadger'
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resque-honeybadger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jacques Crocker
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: resque
16
+ requirement: &70204656822680 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.8.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70204656822680
25
+ - !ruby/object:Gem::Dependency
26
+ name: honeybadger
27
+ requirement: &70204656822080 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70204656822080
36
+ description: ! " resque-honeybadger provides a Resque failure backend that sends
37
+ exceptions\n raised by jobs to honeybadger.io.\n"
38
+ email: railsjedi@gmail.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - LICENSE
44
+ - Rakefile
45
+ - README.md
46
+ - HISTORY.md
47
+ - lib/resque/failure/honeybadger.rb
48
+ - lib/resque-honeybadger.rb
49
+ homepage: http://github.com/lantins/resque-honeybadger
50
+ licenses: []
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ requirements: []
68
+ rubyforge_project:
69
+ rubygems_version: 1.8.5
70
+ signing_key:
71
+ specification_version: 3
72
+ summary: A Resque failure backend for honeybadger.io
73
+ test_files: []
74
+ has_rdoc: false