Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: resque/resque
...
head fork: jamesdaniels/resque
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
1  Gemfile
@@ -9,7 +9,6 @@ group :test do
gem "leftright", :platforms => :mri_18
gem "yajl-ruby", "~>0.8.2", :platforms => :mri
gem "json", "~>1.5.3", :platforms => [:jruby, :rbx]
- gem "hoptoad_notifier"
gem "airbrake"
gem "i18n"
end
View
4 lib/resque/failure.rb
@@ -22,8 +22,8 @@ def self.create(options = {})
# `Resque::Failure::Base`.
#
# Example use:
- # require 'resque/failure/hoptoad'
- # Resque::Failure.backend = Resque::Failure::Hoptoad
+ # require 'resque/failure/airbrake'
+ # Resque::Failure.backend = Resque::Failure::Airbrake
def self.backend=(backend)
@backend = backend
end
View
33 lib/resque/failure/hoptoad.rb
@@ -1,33 +0,0 @@
-begin
- require 'hoptoad_notifier'
-rescue LoadError
- raise "Can't find 'hoptoad_notifier' gem. Please add it to your Gemfile or install it."
-end
-
-require 'resque/failure/thoughtbot'
-
-module Resque
- module Failure
- # A Failure backend that sends exceptions raised by jobs to Hoptoad.
- #
- # To use it, put this code in an initializer, Rake task, or wherever:
- #
- # require 'resque/failure/hoptoad'
- #
- # Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Hoptoad]
- # Resque::Failure.backend = Resque::Failure::Multiple
- #
- # Once you've configured resque to use the Hoptoad failure backend,
- # you'll want to setup an initializer to configure the Hoptoad.
- #
- # HoptoadNotifier.configure do |config|
- # config.api_key = 'your_key_here'
- # end
- # For more information see https://github.com/thoughtbot/hoptoad_notifier
- class Hoptoad < Base
- include Resque::Failure::Thoughtbot
-
- @klass = ::HoptoadNotifier
- end
- end
-end
View
2  lib/resque/failure/thoughtbot.rb
@@ -14,7 +14,7 @@ def configure(&block)
end
def count
- # We can't get the total # of errors from Hoptoad so we fake it
+ # We can't get the total # of errors from Airbrake so we fake it
# by asking Resque how many errors it has seen.
Stat[:failed]
end
View
26 test/hoptoad_test.rb
@@ -1,26 +0,0 @@
-require 'test_helper'
-
-begin
- require 'hoptoad_notifier'
-rescue LoadError
- warn "Install hoptoad_notifier gem to run Hoptoad tests."
-end
-
-if defined? HoptoadNotifier
- require 'resque/failure/hoptoad'
- context "Hoptoad" do
- test "should be notified of an error" do
- exception = StandardError.new("BOOM")
- worker = Resque::Worker.new(:test)
- queue = "test"
- payload = {'class' => Object, 'args' => 66}
-
- HoptoadNotifier.expects(:notify_or_ignore).with(
- exception,
- :parameters => {:payload_class => 'Object', :payload_args => '66'})
-
- backend = Resque::Failure::Hoptoad.new(exception, worker, queue, payload)
- backend.save
- end
- end
-end

No commit comments for this range

Something went wrong with that request. Please try again.