memcache-client 1.8.2 → 1.8.3

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.
@@ -1,3 +1,7 @@
1
+ = 1.8.3 (2010-04-26)
2
+
3
+ * Don't allow blank keys. (Bill Horsman)
4
+
1
5
  = 1.8.2 (2010-04-03)
2
6
 
3
7
  * Fix concurrency issues with eventmachine support.
@@ -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
@@ -2,5 +2,5 @@ class MemCache
2
2
  ##
3
3
  # The version of MemCache you are using.
4
4
 
5
- VERSION = "1.8.2"
5
+ VERSION = "1.8.3"
6
6
  end
@@ -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
- - 2
9
- version: 1.8.2
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-03 00:00:00 -05:00
19
+ date: 2010-04-26 00:00:00 -05:00
20
20
  default_executable: memcached_top
21
21
  dependencies: []
22
22