redis 2.0.9 → 2.0.10

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/client.rb CHANGED
@@ -286,7 +286,7 @@ class Redis
286
286
  end
287
287
  end
288
288
 
289
- if defined?(Encoding)
289
+ if defined?(Encoding::default_external)
290
290
  def encode(string)
291
291
  string.force_encoding(Encoding::default_external)
292
292
  end
data/lib/redis.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'socket'
2
2
 
3
3
  class Redis
4
- VERSION = "2.0.9"
4
+ VERSION = "2.0.10"
5
5
 
6
6
  class ProtocolError < RuntimeError
7
7
  def initialize(reply_type)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 9
9
- version: 2.0.9
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-17 00:00:00 -03:00
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