redis-namespace 1.4.1 → 1.5.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/lib/redis/namespace.rb +59 -28
- data/lib/redis/namespace/version.rb +1 -1
- data/spec/deprecation_spec.rb +79 -0
- data/spec/redis_spec.rb +83 -28
- data/spec/spec_helper.rb +54 -9
- metadata +79 -72
data/lib/redis/namespace.rb
CHANGED
|
@@ -61,7 +61,7 @@ class Redis
|
|
|
61
61
|
"bitcount" => [ :first ],
|
|
62
62
|
"bitop" => [ :exclude_first ],
|
|
63
63
|
"blpop" => [ :exclude_last, :first ],
|
|
64
|
-
"brpop" => [ :exclude_last ],
|
|
64
|
+
"brpop" => [ :exclude_last, :first ],
|
|
65
65
|
"brpoplpush" => [ :exclude_last ],
|
|
66
66
|
"config" => [],
|
|
67
67
|
"dbsize" => [],
|
|
@@ -123,12 +123,16 @@ class Redis
|
|
|
123
123
|
"mget" => [ :all ],
|
|
124
124
|
"monitor" => [ :monitor ],
|
|
125
125
|
"move" => [ :first ],
|
|
126
|
+
"multi" => [],
|
|
126
127
|
"mset" => [ :alternate ],
|
|
127
128
|
"msetnx" => [ :alternate ],
|
|
128
129
|
"object" => [ :exclude_first ],
|
|
129
130
|
"persist" => [ :first ],
|
|
130
131
|
"pexpire" => [ :first ],
|
|
131
132
|
"pexpireat" => [ :first ],
|
|
133
|
+
"pfadd" => [ :first ],
|
|
134
|
+
"pfcount" => [ :all ],
|
|
135
|
+
"pfmerge" => [ :all ],
|
|
132
136
|
"ping" => [],
|
|
133
137
|
"psetex" => [ :first ],
|
|
134
138
|
"psubscribe" => [ :all ],
|
|
@@ -149,6 +153,7 @@ class Redis
|
|
|
149
153
|
"scard" => [ :first ],
|
|
150
154
|
"scan" => [ :scan_style, :second ],
|
|
151
155
|
"scan_each" => [ :scan_style, :all ],
|
|
156
|
+
"script" => [],
|
|
152
157
|
"sdiff" => [ :all ],
|
|
153
158
|
"sdiffstore" => [ :all ],
|
|
154
159
|
"select" => [],
|
|
@@ -203,13 +208,6 @@ class Redis
|
|
|
203
208
|
# Support 1.8.7 by providing a namespaced reference to Enumerable::Enumerator
|
|
204
209
|
Enumerator = Enumerable::Enumerator unless defined?(::Enumerator)
|
|
205
210
|
|
|
206
|
-
# support previous versions of redis gem
|
|
207
|
-
ALIASES = case
|
|
208
|
-
when defined? Redis::Client::ALIASES then Redis::Client::ALIASES
|
|
209
|
-
when defined? Redis::ALIASES then Redis::ALIASES
|
|
210
|
-
else {}
|
|
211
|
-
end
|
|
212
|
-
|
|
213
211
|
attr_writer :namespace
|
|
214
212
|
attr_reader :redis
|
|
215
213
|
attr_accessor :warning
|
|
@@ -217,34 +215,42 @@ class Redis
|
|
|
217
215
|
def initialize(namespace, options = {})
|
|
218
216
|
@namespace = namespace
|
|
219
217
|
@redis = options[:redis] || Redis.current
|
|
220
|
-
@warning = options
|
|
218
|
+
@warning = options.fetch(:warning, true)
|
|
219
|
+
@deprecations = !!options.fetch(:deprecations) do
|
|
220
|
+
ENV['REDIS_NAMESPACE_DEPRECATIONS']
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
def deprecations?
|
|
225
|
+
@deprecations
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
def client
|
|
229
|
+
@redis.client
|
|
221
230
|
end
|
|
222
231
|
|
|
223
232
|
# Ruby defines a now deprecated type method so we need to override it here
|
|
224
233
|
# since it will never hit method_missing
|
|
225
234
|
def type(key)
|
|
226
|
-
|
|
235
|
+
call_with_namespace(:type, key)
|
|
227
236
|
end
|
|
228
237
|
|
|
229
238
|
alias_method :self_respond_to?, :respond_to?
|
|
230
239
|
|
|
240
|
+
# emulate Ruby 1.9+ and keep respond_to_missing? logic together.
|
|
231
241
|
def respond_to?(command, include_private=false)
|
|
232
|
-
|
|
233
|
-
true
|
|
234
|
-
else
|
|
235
|
-
@redis.respond_to?(command, include_private)
|
|
236
|
-
end
|
|
242
|
+
super or respond_to_missing?(command, include_private)
|
|
237
243
|
end
|
|
238
244
|
|
|
239
245
|
def keys(query = nil)
|
|
240
|
-
query
|
|
246
|
+
call_with_namespace(:keys, query || '*')
|
|
241
247
|
end
|
|
242
248
|
|
|
243
249
|
def multi(&block)
|
|
244
250
|
if block_given?
|
|
245
251
|
namespaced_block(:multi, &block)
|
|
246
252
|
else
|
|
247
|
-
|
|
253
|
+
call_with_namespace(:multi)
|
|
248
254
|
end
|
|
249
255
|
end
|
|
250
256
|
|
|
@@ -262,24 +268,49 @@ class Redis
|
|
|
262
268
|
end
|
|
263
269
|
|
|
264
270
|
def exec
|
|
265
|
-
|
|
271
|
+
call_with_namespace(:exec)
|
|
266
272
|
end
|
|
267
273
|
|
|
268
274
|
def eval(*args)
|
|
269
|
-
|
|
275
|
+
call_with_namespace(:eval, *args)
|
|
270
276
|
end
|
|
271
277
|
|
|
272
278
|
def method_missing(command, *args, &block)
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
normalized_command = command.to_s.downcase
|
|
280
|
+
|
|
281
|
+
if COMMANDS.include?(normalized_command)
|
|
282
|
+
call_with_namespace(command, *args, &block)
|
|
283
|
+
elsif @redis.respond_to?(normalized_command) && !deprecations?
|
|
284
|
+
# blind passthrough is deprecated and will be removed in 2.0
|
|
285
|
+
# redis-namespace does not know how to handle this command.
|
|
286
|
+
# Passing it to @redis as is, where redis-namespace shows
|
|
287
|
+
# a warning message if @warning is set.
|
|
288
|
+
if @warning
|
|
289
|
+
call_site = caller.reject { |l| l.start_with?(__FILE__) }.first
|
|
290
|
+
warn("Passing '#{command}' command to redis as is (at #{call_site})")
|
|
291
|
+
end
|
|
292
|
+
@redis.send(command, *args, &block)
|
|
293
|
+
else
|
|
294
|
+
super
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
def respond_to_missing?(command, include_all=false)
|
|
299
|
+
return true if COMMANDS.include?(command.to_s.downcase)
|
|
300
|
+
|
|
301
|
+
# blind passthrough is deprecated and will be removed in 2.0
|
|
302
|
+
if @redis.respond_to?(command, include_all) && !deprecations?
|
|
303
|
+
return true
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
defined?(super) && super
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
def call_with_namespace(command, *args, &block)
|
|
310
|
+
handling = COMMANDS[command.to_s.downcase]
|
|
276
311
|
|
|
277
|
-
# redis-namespace does not know how to handle this command.
|
|
278
|
-
# Passing it to @redis as is, where redis-namespace shows
|
|
279
|
-
# a warning message if @warning is set.
|
|
280
312
|
if handling.nil?
|
|
281
|
-
|
|
282
|
-
return @redis.send(command, *args, &block)
|
|
313
|
+
fail("Redis::Namespace does not know how to handle '#{command}'.")
|
|
283
314
|
end
|
|
284
315
|
|
|
285
316
|
(before, after) = handling
|
|
@@ -413,7 +444,7 @@ class Redis
|
|
|
413
444
|
# Enumerator in 1.8.7 *requires* a single argument, so we need to use
|
|
414
445
|
# its Generator class, which matches the block syntax of 1.9.x's
|
|
415
446
|
# Enumerator class.
|
|
416
|
-
if
|
|
447
|
+
if RUBY_VERSION.start_with?('1.8')
|
|
417
448
|
require 'generator' unless defined?(Generator)
|
|
418
449
|
Generator.new(&block).to_enum
|
|
419
450
|
else
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'stringio'
|
|
4
|
+
|
|
5
|
+
describe Redis::Namespace do
|
|
6
|
+
# Blind passthrough of unhandled commands will be removed
|
|
7
|
+
# in 2.0; the following tests ensure that we support them
|
|
8
|
+
# until that point, & that we can programatically disable
|
|
9
|
+
# them in the meantime.
|
|
10
|
+
context 'deprecated 1.x behaviour' do
|
|
11
|
+
let(:redis) { double(Redis) }
|
|
12
|
+
let(:namespaced) do
|
|
13
|
+
Redis::Namespace.new(:ns, options.merge(:redis => redis))
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
let(:options) { Hash.new }
|
|
17
|
+
|
|
18
|
+
subject { namespaced }
|
|
19
|
+
|
|
20
|
+
its(:deprecations?) { should be false }
|
|
21
|
+
|
|
22
|
+
context('with REDIS_NAMESPACE_DEPRECATIONS') do
|
|
23
|
+
around(:each) {|e| with_env('REDIS_NAMESPACE_DEPRECATIONS'=>'1', &e) }
|
|
24
|
+
its(:deprecations?) { should be true }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
before(:each) do
|
|
28
|
+
allow(redis).to receive(:unhandled) do |*args|
|
|
29
|
+
"unhandled(#{args.inspect})"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# This behaviour will hold true after the 2.x migration
|
|
34
|
+
context('with deprecations enabled') do
|
|
35
|
+
let(:options) { {:deprecations => true} }
|
|
36
|
+
its(:deprecations?) { should be true }
|
|
37
|
+
|
|
38
|
+
context('with an unhandled command') do
|
|
39
|
+
it { should_not respond_to :unhandled }
|
|
40
|
+
|
|
41
|
+
it('raises a NoMethodError') do
|
|
42
|
+
expect do
|
|
43
|
+
namespaced.unhandled('foo')
|
|
44
|
+
end.to raise_exception NoMethodError
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# This behaviour will no longer be available after the 2.x migration
|
|
50
|
+
context('with deprecations disabled') do
|
|
51
|
+
let(:options) { {:deprecations => false} }
|
|
52
|
+
its(:deprecations?) { should be false }
|
|
53
|
+
|
|
54
|
+
context('with an an unhandled command') do
|
|
55
|
+
it { should respond_to :unhandled }
|
|
56
|
+
|
|
57
|
+
it 'blindly passes through' do
|
|
58
|
+
expect(redis).to receive(:unhandled)
|
|
59
|
+
|
|
60
|
+
capture_stderr do
|
|
61
|
+
response = namespaced.unhandled('foo')
|
|
62
|
+
expect(response).to eq 'unhandled(["foo"])'
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'warns with helpful output' do
|
|
67
|
+
capture_stderr(stderr = StringIO.new) do
|
|
68
|
+
namespaced.unhandled('bar')
|
|
69
|
+
end
|
|
70
|
+
warning = stderr.tap(&:rewind).read
|
|
71
|
+
|
|
72
|
+
expect(warning).to_not be_empty
|
|
73
|
+
expect(warning).to include %q(Passing 'unhandled' command to redis as is)
|
|
74
|
+
expect(warning).to include __FILE__
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
data/spec/redis_spec.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
1
3
|
require File.dirname(__FILE__) + '/spec_helper'
|
|
2
4
|
|
|
3
5
|
describe "redis" do
|
|
@@ -223,6 +225,36 @@ describe "redis" do
|
|
|
223
225
|
@namespaced.zrevrange('union', 0, -1).should eq(%w( 4 2 3 1 ))
|
|
224
226
|
end
|
|
225
227
|
|
|
228
|
+
it "should properly intersect two sorted sets without options" do
|
|
229
|
+
@namespaced.zadd('food', 1, 'orange')
|
|
230
|
+
@namespaced.zadd('food', 2, 'banana')
|
|
231
|
+
@namespaced.zadd('food', 3, 'eggplant')
|
|
232
|
+
|
|
233
|
+
@namespaced.zadd('color', 2, 'orange')
|
|
234
|
+
@namespaced.zadd('color', 3, 'yellow')
|
|
235
|
+
@namespaced.zadd('color', 4, 'eggplant')
|
|
236
|
+
|
|
237
|
+
@namespaced.zinterstore('inter', ['food', 'color'])
|
|
238
|
+
|
|
239
|
+
inter_values = @namespaced.zrevrange('inter', 0, -1, :with_scores => true)
|
|
240
|
+
inter_values.should =~ [['orange', 3.0], ['eggplant', 7.0]]
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
it "should properly intersect two sorted sets with options" do
|
|
244
|
+
@namespaced.zadd('food', 1, 'orange')
|
|
245
|
+
@namespaced.zadd('food', 2, 'banana')
|
|
246
|
+
@namespaced.zadd('food', 3, 'eggplant')
|
|
247
|
+
|
|
248
|
+
@namespaced.zadd('color', 2, 'orange')
|
|
249
|
+
@namespaced.zadd('color', 3, 'yellow')
|
|
250
|
+
@namespaced.zadd('color', 4, 'eggplant')
|
|
251
|
+
|
|
252
|
+
@namespaced.zinterstore('inter', ['food', 'color'], :aggregate => "min")
|
|
253
|
+
|
|
254
|
+
inter_values = @namespaced.zrevrange('inter', 0, -1, :with_scores => true)
|
|
255
|
+
inter_values.should =~ [['orange', 1.0], ['eggplant', 3.0]]
|
|
256
|
+
end
|
|
257
|
+
|
|
226
258
|
it "should add namespace to sort" do
|
|
227
259
|
@namespaced.sadd('foo', 1)
|
|
228
260
|
@namespaced.sadd('foo', 2)
|
|
@@ -342,26 +374,54 @@ describe "redis" do
|
|
|
342
374
|
@namespaced.respond_to?(:warning=).should == true
|
|
343
375
|
end
|
|
344
376
|
|
|
345
|
-
it "should
|
|
346
|
-
@namespaced.
|
|
347
|
-
capture_stderr {
|
|
348
|
-
@namespaced.unknown('foo')
|
|
349
|
-
}.should == "Passing 'unknown' command to redis as is."
|
|
377
|
+
it "should raise an exception when an unknown command is passed" do
|
|
378
|
+
expect { @namespaced.unknown('foo') }.to raise_exception NoMethodError
|
|
350
379
|
end
|
|
351
380
|
|
|
352
381
|
# Redis 2.6 RC reports its version as 2.5.
|
|
353
382
|
if @redis_version >= Gem::Version.new("2.5.0")
|
|
354
383
|
describe "redis 2.6 commands" do
|
|
355
384
|
it "should namespace bitcount" do
|
|
356
|
-
|
|
385
|
+
@redis.set('ns:foo', 'foobar')
|
|
386
|
+
expect(@namespaced.bitcount('foo')).to eq 26
|
|
387
|
+
expect(@namespaced.bitcount('foo', 0, 0)).to eq 4
|
|
388
|
+
expect(@namespaced.bitcount('foo', 1, 1)).to eq 6
|
|
389
|
+
expect(@namespaced.bitcount('foo', 3, 5)).to eq 10
|
|
357
390
|
end
|
|
358
391
|
|
|
359
392
|
it "should namespace bitop" do
|
|
360
|
-
|
|
393
|
+
try_encoding('UTF-8') do
|
|
394
|
+
@redis.set("ns:foo", "a")
|
|
395
|
+
@redis.set("ns:bar", "b")
|
|
396
|
+
|
|
397
|
+
@namespaced.bitop(:and, "foo&bar", "foo", "bar")
|
|
398
|
+
@namespaced.bitop(:or, "foo|bar", "foo", "bar")
|
|
399
|
+
@namespaced.bitop(:xor, "foo^bar", "foo", "bar")
|
|
400
|
+
@namespaced.bitop(:not, "~foo", "foo")
|
|
401
|
+
|
|
402
|
+
expect(@redis.get("ns:foo&bar")).to eq "\x60"
|
|
403
|
+
expect(@redis.get("ns:foo|bar")).to eq "\x63"
|
|
404
|
+
expect(@redis.get("ns:foo^bar")).to eq "\x03"
|
|
405
|
+
expect(@redis.get("ns:~foo")).to eq "\x9E"
|
|
406
|
+
end
|
|
361
407
|
end
|
|
362
408
|
|
|
363
|
-
it "should namespace dump" do
|
|
364
|
-
|
|
409
|
+
it "should namespace dump and restore" do
|
|
410
|
+
@redis.set("ns:foo", "a")
|
|
411
|
+
v = @namespaced.dump("foo")
|
|
412
|
+
@redis.del("ns:foo")
|
|
413
|
+
|
|
414
|
+
expect(@namespaced.restore("foo", 1000, v)).to be_true
|
|
415
|
+
expect(@redis.get("ns:foo")).to eq 'a'
|
|
416
|
+
expect(@redis.ttl("ns:foo")).to satisfy {|v| (0..1).include?(v) }
|
|
417
|
+
|
|
418
|
+
@redis.rpush("ns:bar", %w(b c d))
|
|
419
|
+
w = @namespaced.dump("bar")
|
|
420
|
+
@redis.del("ns:bar")
|
|
421
|
+
|
|
422
|
+
expect(@namespaced.restore("bar", 1000, w)).to be_true
|
|
423
|
+
expect(@redis.lrange('ns:bar', 0, -1)).to eq %w(b c d)
|
|
424
|
+
expect(@redis.ttl("ns:foo")).to satisfy {|v| (0..1).include?(v) }
|
|
365
425
|
end
|
|
366
426
|
|
|
367
427
|
it "should namespace hincrbyfloat" do
|
|
@@ -407,10 +467,6 @@ describe "redis" do
|
|
|
407
467
|
@namespaced.pttl('mykey').should >= 0
|
|
408
468
|
end
|
|
409
469
|
|
|
410
|
-
it "should namespace restore" do
|
|
411
|
-
pending "awaiting implementaton of command in redis gem"
|
|
412
|
-
end
|
|
413
|
-
|
|
414
470
|
it "should namespace eval keys passed in as array args" do
|
|
415
471
|
@namespaced.
|
|
416
472
|
eval("return {KEYS[1], KEYS[2]}", %w[k1 k2], %w[arg1 arg2]).
|
|
@@ -713,26 +769,25 @@ describe "redis" do
|
|
|
713
769
|
end
|
|
714
770
|
end
|
|
715
771
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
@
|
|
720
|
-
@redis.should_not have_key('ns:foo')
|
|
772
|
+
if @redis_version >= Gem::Version.new("2.8.9")
|
|
773
|
+
it 'should namespace pfadd' do
|
|
774
|
+
5.times { |n| @namespaced.pfadd("pf", n) }
|
|
775
|
+
@redis.pfcount("ns:pf").should == 5
|
|
721
776
|
end
|
|
722
777
|
|
|
723
|
-
it
|
|
724
|
-
@
|
|
725
|
-
@namespaced.
|
|
778
|
+
it 'should namespace pfcount' do
|
|
779
|
+
5.times { |n| @redis.pfadd("ns:pf", n) }
|
|
780
|
+
@namespaced.pfcount("pf").should == 5
|
|
726
781
|
end
|
|
727
782
|
|
|
728
|
-
it
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
783
|
+
it 'should namespace pfmerge' do
|
|
784
|
+
5.times do |n|
|
|
785
|
+
@redis.pfadd("ns:pfa", n)
|
|
786
|
+
@redis.pfadd("ns:pfb", n+5)
|
|
787
|
+
end
|
|
732
788
|
|
|
733
|
-
|
|
734
|
-
@
|
|
735
|
-
@redis.zcard('ns:bar').should eq(1)
|
|
789
|
+
@namespaced.pfmerge("pfc", "pfa", "pfb")
|
|
790
|
+
@redis.pfcount("ns:pfc").should == 10
|
|
736
791
|
end
|
|
737
792
|
end
|
|
738
793
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -11,18 +11,63 @@ $TESTING=true
|
|
|
11
11
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
|
12
12
|
require 'redis/namespace'
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
module Helper
|
|
15
|
+
def capture_stderr(io = nil)
|
|
16
|
+
require 'stringio'
|
|
17
|
+
io ||= StringIO.new
|
|
18
|
+
begin
|
|
19
|
+
original, $stderr = $stderr, io
|
|
20
|
+
yield
|
|
21
|
+
rescue Redis::CommandError
|
|
22
|
+
# ignore Redis::CommandError for test and
|
|
23
|
+
# return captured messages
|
|
24
|
+
$stderr.string.chomp
|
|
25
|
+
ensure
|
|
26
|
+
$stderr = original
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def with_env(env = {})
|
|
31
|
+
backup_env = ENV.to_hash.dup
|
|
32
|
+
ENV.update(env)
|
|
33
|
+
|
|
18
34
|
yield
|
|
19
|
-
rescue Redis::CommandError
|
|
20
|
-
# ignore Redis::CommandError for test and
|
|
21
|
-
# return captured messages
|
|
22
|
-
$stderr.string.chomp
|
|
23
35
|
ensure
|
|
24
|
-
|
|
36
|
+
ENV.replace(backup_env)
|
|
25
37
|
end
|
|
38
|
+
|
|
39
|
+
def silent
|
|
40
|
+
verbose, $VERBOSE = $VERBOSE, false
|
|
41
|
+
|
|
42
|
+
begin
|
|
43
|
+
yield
|
|
44
|
+
ensure
|
|
45
|
+
$VERBOSE = verbose
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def with_external_encoding(encoding)
|
|
50
|
+
original_encoding = Encoding.default_external
|
|
51
|
+
|
|
52
|
+
begin
|
|
53
|
+
silent { Encoding.default_external = Encoding.find(encoding) }
|
|
54
|
+
yield
|
|
55
|
+
ensure
|
|
56
|
+
silent { Encoding.default_external = original_encoding }
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def try_encoding(encoding, &block)
|
|
61
|
+
if defined?(Encoding)
|
|
62
|
+
with_external_encoding(encoding, &block)
|
|
63
|
+
else
|
|
64
|
+
yield
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
RSpec.configure do |c|
|
|
70
|
+
c.include Helper
|
|
26
71
|
end
|
|
27
72
|
|
|
28
73
|
RSpec::Matchers.define :have_key do |expected|
|
metadata
CHANGED
|
@@ -1,115 +1,122 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redis-namespace
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
- 1
|
|
7
|
-
- 4
|
|
8
|
-
- 1
|
|
9
|
-
version: 1.4.1
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.5.0
|
|
5
|
+
prerelease:
|
|
10
6
|
platform: ruby
|
|
11
|
-
authors:
|
|
7
|
+
authors:
|
|
12
8
|
- Chris Wanstrath
|
|
13
9
|
- Terence Lee
|
|
14
10
|
- Steve Klabnik
|
|
11
|
+
- Ryan Biesemeyer
|
|
15
12
|
autorequire:
|
|
16
13
|
bindir: bin
|
|
17
14
|
cert_chain: []
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dependencies:
|
|
22
|
-
- !ruby/object:Gem::Dependency
|
|
15
|
+
date: 2014-06-24 00:00:00.000000000 Z
|
|
16
|
+
dependencies:
|
|
17
|
+
- !ruby/object:Gem::Dependency
|
|
23
18
|
name: redis
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
requirements:
|
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
|
20
|
+
none: false
|
|
21
|
+
requirements:
|
|
27
22
|
- - ~>
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- 4
|
|
23
|
+
- !ruby/object:Gem::Version
|
|
24
|
+
version: '3.0'
|
|
25
|
+
- - ! '>='
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
33
27
|
version: 3.0.4
|
|
34
28
|
type: :runtime
|
|
35
|
-
version_requirements: *id001
|
|
36
|
-
- !ruby/object:Gem::Dependency
|
|
37
|
-
name: rake
|
|
38
29
|
prerelease: false
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
31
|
+
none: false
|
|
32
|
+
requirements:
|
|
33
|
+
- - ~>
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: '3.0'
|
|
36
|
+
- - ! '>='
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: 3.0.4
|
|
39
|
+
- !ruby/object:Gem::Dependency
|
|
40
|
+
name: rake
|
|
41
|
+
requirement: !ruby/object:Gem::Requirement
|
|
42
|
+
none: false
|
|
43
|
+
requirements:
|
|
44
|
+
- - ~>
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '10.1'
|
|
46
47
|
type: :development
|
|
47
|
-
version_requirements: *id002
|
|
48
|
-
- !ruby/object:Gem::Dependency
|
|
49
|
-
name: rspec
|
|
50
48
|
prerelease: false
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
none: false
|
|
51
|
+
requirements:
|
|
52
|
+
- - ~>
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '10.1'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
none: false
|
|
59
|
+
requirements:
|
|
60
|
+
- - ~>
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '2.14'
|
|
58
63
|
type: :development
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
prerelease: false
|
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
+
none: false
|
|
67
|
+
requirements:
|
|
68
|
+
- - ~>
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: '2.14'
|
|
71
|
+
description: ! 'Adds a Redis::Namespace class which can be used to namespace calls
|
|
72
|
+
|
|
62
73
|
to Redis. This is useful when using a single instance of Redis with
|
|
74
|
+
|
|
63
75
|
multiple, different applications.
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
'
|
|
78
|
+
email:
|
|
66
79
|
- chris@ozmm.org
|
|
67
80
|
- hone02@gmail.com
|
|
68
81
|
- steve@steveklabnik.com
|
|
82
|
+
- me@yaauie.com
|
|
69
83
|
executables: []
|
|
70
|
-
|
|
71
84
|
extensions: []
|
|
72
|
-
|
|
73
85
|
extra_rdoc_files: []
|
|
74
|
-
|
|
75
|
-
files:
|
|
86
|
+
files:
|
|
76
87
|
- README.md
|
|
77
88
|
- Rakefile
|
|
78
89
|
- LICENSE
|
|
79
90
|
- lib/redis/namespace/version.rb
|
|
80
91
|
- lib/redis/namespace.rb
|
|
81
92
|
- lib/redis-namespace.rb
|
|
93
|
+
- spec/deprecation_spec.rb
|
|
82
94
|
- spec/redis_spec.rb
|
|
83
95
|
- spec/spec_helper.rb
|
|
84
|
-
has_rdoc: true
|
|
85
96
|
homepage: http://github.com/resque/redis-namespace
|
|
86
|
-
licenses:
|
|
87
|
-
|
|
97
|
+
licenses:
|
|
98
|
+
- MIT
|
|
88
99
|
post_install_message:
|
|
89
100
|
rdoc_options: []
|
|
90
|
-
|
|
91
|
-
require_paths:
|
|
101
|
+
require_paths:
|
|
92
102
|
- lib
|
|
93
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
requirements:
|
|
102
|
-
- -
|
|
103
|
-
- !ruby/object:Gem::Version
|
|
104
|
-
|
|
105
|
-
- 0
|
|
106
|
-
version: "0"
|
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
|
+
none: false
|
|
105
|
+
requirements:
|
|
106
|
+
- - ! '>='
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '0'
|
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
|
+
none: false
|
|
111
|
+
requirements:
|
|
112
|
+
- - ! '>='
|
|
113
|
+
- !ruby/object:Gem::Version
|
|
114
|
+
version: '0'
|
|
107
115
|
requirements: []
|
|
108
|
-
|
|
109
116
|
rubyforge_project:
|
|
110
|
-
rubygems_version: 1.
|
|
117
|
+
rubygems_version: 1.8.23
|
|
111
118
|
signing_key:
|
|
112
119
|
specification_version: 3
|
|
113
120
|
summary: Namespaces Redis commands.
|
|
114
121
|
test_files: []
|
|
115
|
-
|
|
122
|
+
has_rdoc: false
|