redis 2.0.9 → 2.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/redis/client.rb +1 -1
- data/lib/redis.rb +1 -1
- metadata +3 -4
- data/lib/redis/url.rb +0 -69
data/lib/redis/client.rb
CHANGED
data/lib/redis.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 2.0.
|
8
|
+
- 10
|
9
|
+
version: 2.0.10
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ezra Zygmuntowicz
|
@@ -21,7 +21,7 @@ autorequire: redis
|
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
23
|
|
24
|
-
date: 2010-09-
|
24
|
+
date: 2010-09-20 00:00:00 -03:00
|
25
25
|
default_executable:
|
26
26
|
dependencies: []
|
27
27
|
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- lib/redis/hash_ring.rb
|
44
44
|
- lib/redis/pipeline.rb
|
45
45
|
- lib/redis/subscribe.rb
|
46
|
-
- lib/redis/url.rb
|
47
46
|
- lib/redis.rb
|
48
47
|
has_rdoc: true
|
49
48
|
homepage: http://github.com/ezmobius/redis-rb
|
data/lib/redis/url.rb
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
require "uri/generic"
|
2
|
-
|
3
|
-
module URI
|
4
|
-
class Redis < Generic
|
5
|
-
DEFAULT_PORT = 6379
|
6
|
-
|
7
|
-
COMPONENT = [:scheme, :password, :host, :port, :db].freeze
|
8
|
-
|
9
|
-
def db
|
10
|
-
path[1..-1].to_i
|
11
|
-
end
|
12
|
-
|
13
|
-
alias password user
|
14
|
-
|
15
|
-
protected
|
16
|
-
def check_path(value)
|
17
|
-
if super(value)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
@@schemes["REDIS"] = Redis
|
23
|
-
end
|
24
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
|
25
|
-
require "redis/url"
|
26
|
-
|
27
|
-
class RedisURLTest < Test::Unit::TestCase
|
28
|
-
test "default values" do
|
29
|
-
uri = URI.parse("redis://localhost")
|
30
|
-
|
31
|
-
assert_equal "localhost", uri.host
|
32
|
-
assert_equal 6379, uri.port
|
33
|
-
assert_equal 0, uri.db
|
34
|
-
assert_equal nil, uri.password
|
35
|
-
end
|
36
|
-
|
37
|
-
test "password" do
|
38
|
-
uri = URI.parse("redis://secret@localhost")
|
39
|
-
|
40
|
-
assert_equal "localhost", uri.host
|
41
|
-
assert_equal 6379, uri.port
|
42
|
-
assert_equal 0, uri.db
|
43
|
-
assert_equal "secret", uri.password
|
44
|
-
end
|
45
|
-
|
46
|
-
test "db number" do
|
47
|
-
uri = URI.parse("redis://secret@localhost/15")
|
48
|
-
|
49
|
-
assert_equal "localhost", uri.host
|
50
|
-
assert_equal 6379, uri.port
|
51
|
-
assert_equal 15, uri.db
|
52
|
-
assert_equal "secret", uri.password
|
53
|
-
end
|
54
|
-
|
55
|
-
test "port" do
|
56
|
-
uri = URI.parse("redis://localhost:6380")
|
57
|
-
|
58
|
-
assert_equal "localhost", uri.host
|
59
|
-
assert_equal 6380, uri.port
|
60
|
-
assert_equal 0, uri.db
|
61
|
-
assert_equal nil, uri.password
|
62
|
-
end
|
63
|
-
|
64
|
-
test "to_s" do
|
65
|
-
uri = URI.parse("redis://secret@localhost:6380/15")
|
66
|
-
|
67
|
-
assert_equal "redis://secret@localhost:6380/15", uri.to_s
|
68
|
-
end
|
69
|
-
end
|