Fixes bug when removing all jobs of a class. Should always return number of jobs removed.
Merge pull request #716 from kjwierenga/feature/dequeue-should-return-count

Resque.dequeue should return number of jobs when removing all jobs of the specified class.
Revamp Resque::Failure

I'd like to add a different failure backend to Resque with support for
multiple queues (and based on Redis sorted sets). However, when I dove
into the failed.erb template in order to facilitate this change, I
discovered it was, well... bad?

This change moves iteration of failures into Resque::Failure.each and
now uses that in the template. Many other minor tweaks to the template
are also added to make it more generic and less wonky.
Initial multiqueue spike

Still a lot of stuff to be done, but this change implements the basic
functionality needed to support multiple failure queues.
Multiple failed queue overview

This implements a summary page in the event we are using multiple failed
queues. The present implementation isn't super awesome but maybe some
kind soul can help clean it up ;)
Fix queue tags on all failed page
Show total counts for all queues on overview
Ensure only the topmost failed queue has a red border

The queues view looks a little bit ugly if each row has a red border.
This change ensures the red border is only on the topmost entry. Maybe
this could be done with a first-child selector or something but fuck it
;)
Configure failure backends with FAILURE_BACKEND

This adds a FAILURE_BACKEND environment variable which allows you to
pick which backend is used. There may be a way to do this already but if
so, I can't figure it out.

This also makes Resque::Failure::Redis the default backend and fixes
some things which broke when using that as a backend. Otherwise this
should make all of the changes fully backwards compatible (in theory!)
Fix Resque::Failure.requeue_queue/remove_queue

This includes a bit of refactoring to fix requeue_queue/remove_queue.
The logic that was previously encapsulated in Resque::Failure has been
moved to Resque::Failure::Redis (as this is the only backend that
supports requeuing/removing).

The singletons in Resque::Failure now thunk to the backend (much like
everything else) and a more intelligent backend has been substituted.
Usage of "rand" as part of the removal process has been removed o_O
with empty string being used as a sentinel value for deleted items.

This makes the test pass when using Resque::Failure::Redis as a backend,
however it's still not ready to merge as the tests are presently written
in a way which doesn't work correctly with
Resque::Failure::RedisMultiQueue. That's the next step.
Remove leftover debugging
Requeue support for individual failed queues

This allows the jobs of a single failed queue to be retried individually
without affecting the other failed queues in the system.
Support for clearing individual queues

This allows individual queues to be cleared by hitting the clear button.
Other failed queues will be unaffected.
Fix arity change on Resque::Failure.clear

Resque::Failure::Redis was not updated to reflect this change
Linkify class names in job view
Fix prefixing of retry/clear buttons
resque:failures:sort rake task

This Rake task sorts the "failed" queue into separate failed queues
named after the original job queues, e.g. "myqueue" has a
"myqueue_failed" queue for its failures.

This can be used to migrate to the Resque::Failure::RedisMultiQueue
backend.
Helpers ftw!

This factors some of the more pathetic view code into some helpers
Support for filtering failed queues by class
Factor failed jobs into their own partial