memcache-client 1.8.2 → 1.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +4 -0
- data/lib/memcache.rb +1 -0
- data/lib/memcache/version.rb +1 -1
- data/test/test_mem_cache.rb +7 -0
- metadata +3 -3
data/History.rdoc
CHANGED
data/lib/memcache.rb
CHANGED
@@ -700,6 +700,7 @@ class MemCache
|
|
700
700
|
def get_server_for_key(key, options = {})
|
701
701
|
raise ArgumentError, "illegal character in key #{key.inspect}" if
|
702
702
|
key =~ /\s/
|
703
|
+
raise ArgumentError, "key cannot be blank" if key.nil? || key.strip.size == 0
|
703
704
|
raise ArgumentError, "key too long #{key.inspect}" if key.length > 250
|
704
705
|
raise MemCacheError, "No servers available" if @servers.empty?
|
705
706
|
return @servers.first if @servers.length == 1
|
data/lib/memcache/version.rb
CHANGED
data/test/test_mem_cache.rb
CHANGED
@@ -677,6 +677,13 @@ class TestMemCache < Test::Unit::TestCase
|
|
677
677
|
assert_equal 'illegal character in key "space key"', e.message
|
678
678
|
end
|
679
679
|
|
680
|
+
def test_get_server_for_blank_key
|
681
|
+
e = assert_raise ArgumentError do
|
682
|
+
@cache.get_server_for_key ''
|
683
|
+
end
|
684
|
+
assert_equal 'key cannot be blank', e.message
|
685
|
+
end
|
686
|
+
|
680
687
|
def test_get_server_for_key_length
|
681
688
|
@cache.get_server_for_key 'x' * 250
|
682
689
|
long_key = 'x' * 251
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 1.8.
|
8
|
+
- 3
|
9
|
+
version: 1.8.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Eric Hodel
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-04-
|
19
|
+
date: 2010-04-26 00:00:00 -05:00
|
20
20
|
default_executable: memcached_top
|
21
21
|
dependencies: []
|
22
22
|
|