resque/redis-namespace — pull request #67 by rgraff (2013-09-29 06:16:00+00:00)
Title: Don't proxy `#eval` as it raises TypeError on nested namespaces

Calling eval on a nested namespace causes a TypeError when proxied through method_missing. Added an eval method resolved the issue. Also added a test to make sure evalsha worked as expected when in a nested namespace. The example irb below demonstrates the error.

```irb
irb(main):002:0> first_level = Redis::Namespace.new(:one)
=> #, @warning=false, @namespace=:one>
irb(main):003:0> first_level.eval("return {KEYS[1],KEYS[2]}", :keys => ['k1','k2'], :argv => ['a'])
=> ["one:k1", "one:k2"]
irb(main):004:0> second_level = Redis::Namespace.new(:two, :redis => first_level)
=> #, @warning=false, @namespace=:one>, @warning=false, @namespace=:two>
irb(main):005:0> second_level.eval("return {KEYS[1],KEYS[2]}", :keys => ['k1','k2'], :argv => ['a'])
TypeError: wrong argument type Hash (expected Binding)
from /Users/rgraff/.rbenv/versions/1.9.3-p385-perf/lib/ruby/gems/1.9.1/gems/redis-namespace-1.3.1/lib/redis/namespace.rb:317:in `eval'
from /Users/rgraff/.rbenv/versions/1.9.3-p385-perf/lib/ruby/gems/1.9.1/gems/redis-namespace-1.3.1/lib/redis/namespace.rb:317:in `method_missing'
from (irb):5
from /Users/rgraff/.rbenv/versions/1.9.3-p385-perf/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/commands/console.rb:47:in `start'
from /Users/rgraff/.rbenv/versions/1.9.3-p385-perf/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/commands/console.rb:8:in `start'
from /Users/rgraff/.rbenv/versions/1.9.3-p385-perf/lib/ruby/gems/1.9.1/gems/railties-3.2.14/lib/rails/commands.rb:41:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'
```