resque/redis-namespace — pull request #69 by yaauie (2013-11-06 07:29:53+00:00)
Title: Quick WIP to add support for upcoming scan commands & helpers

The next release of `redis` gem [will have support](https://github.com/redis/redis-rb/blob/530d062e109cc88223d85f5b6efaf4cff220ef51/lib/redis.rb#L2242-L2415) for `scan`, `hscan`, `sscan`, and `zscan` commands, as well as `scan_each`, `hscan_each`, `sscan_each`, and `zscan_each` helper methods that either yield to a given block or return an `Enumerator` that will.

Support must:
- [x] wrap given block for `*_each` methods to remove the namespace
- [x] provide proxy enumerator that does the same for `*_each` methods when no block is given
- [x] wrap last argument's [:match] or provide `"#{@namespace}:*"` if it is missing, but only for `scan`.
- [x] wrap key for `sscan`, `hscan`, and `zscan`
- [ ] properly verify behaviour (I'm leaning toward changing the testing style a bit, will probably tackle that first, so created pending tests for starters)