memcached 1.6.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzBkMTUwZWJjODIyYWZiZDE5OTg1NmRmYzdkOWVkZDE5ZDNiZTkwYw==
5
+ data.tar.gz: !binary |-
6
+ MmQ5YjE1MjFjODkxNTg4YzdlYWUyMmQ5ZDFhNDgxYzVlODAzNWY3NQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YWQ4ZjgxZTQ5M2Q1NzFlYWEzNzdlOTBiYjhhMWUzMzBkMDRjYzVmMDg5NjY4
10
+ MzllODA2YzFlM2NkOTIxYWMwYjkwYmRhODk0OGY2NjI4OWVjMjZlMTlhYzM2
11
+ ZDVlZmJjMjU2NDA2OTNlZDA1YzVhOTViOTdiMGMwZmMyMTI5N2I=
12
+ data.tar.gz: !binary |-
13
+ OThjNTIwYWVhNzhjMDQwYzdjZjIyNTQ4NzlkNTM1Y2FkNWQ0ZmRkOTFhMTY1
14
+ N2Q3YzFkNWFkYWVmN2JmYzBlMDlkOGY2YWI1NWY2MGRlNjlhYTEwYzU2N2Vl
15
+ M2JjYTQzNGVlZmJkMWUzNjk2ZWJkOWJmOGM3OTY4MDk4ZWZiNjI=
@@ -0,0 +1,3 @@
1
+ @��W�*���X�[���e��M!-aP�@�.��4'@#�"��-YI�V�"KS��?�����FщK!��?�†>h0N�׾'��
2
+ �%�����M�9DnN�E)+h^�-���Ź��p�S��[���5�Nģ��:m��ɔ�@����x%
3
+ �������\ �(-y�N97�����DV�&Ѱ1���a^Q�T1p�P�=����udo���CY��(�[b���o��a��r���l��E[�l�
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v1.7.0. Remove legacy :namespace option from base class. Always rescue in Memcached::Rails and log, for people who don't care if their cache is actually working (mnzaki). Add snd_timeout (jreichhold).
2
+
3
+ v1.6.2. Add travis configuration file (tests rubies 1.8.7, 1.9, 2.0, and rbx 1.9 mode). Fixes for unit tests breaking under Ruby 1.8.7. Updated gemspec to add check for signing key so that we can also build unsigned gem. Add travis build status image to README.rdoc. Updates to Memcached::Rails to be more compatible with ActiveSupport's cache API.
1
4
 
2
5
  v1.6.1. Clean up C-level handling of to_str (jason-o-matic).
3
6
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- memcached (1.4.3)
4
+ memcached (1.6.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/Manifest CHANGED
@@ -230,6 +230,7 @@ lib/memcached/marshal_codec.rb
230
230
  lib/memcached/memcached.rb
231
231
  lib/memcached/rails.rb
232
232
  memcached.gemspec
233
+ memcached.pem
233
234
  test/profile/benchmark.rb
234
235
  test/profile/c_profiler.rb
235
236
  test/profile/exercise.rb
@@ -2,6 +2,8 @@ memcached
2
2
 
3
3
  An interface to the libmemcached C client.
4
4
 
5
+ {<img src="https://travis-ci.org/evan/memcached.png" alt="Build Status" />}[https://travis-ci.org/evan/memcached]
6
+
5
7
  == License
6
8
 
7
9
  Copyright 2009-2013 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file. Portions copyright 2007-2009 TangentOrg, Brian Aker, licensed under the BSD license, and used with permission.
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  gem 'echoe', '>= 4.5.6'
2
2
  require 'echoe'
3
3
 
4
+ ENV["GEM_CERTIFICATE_CHAIN"]="memcached.pem"
5
+
4
6
  Echoe.new("memcached") do |p|
5
7
  p.author = "Evan Weaver"
6
8
  p.project = "evan"
@@ -86,6 +86,7 @@ memcached_st *memcached_clone(memcached_st *clone, memcached_st *source)
86
86
  new_clone->send_size= source->send_size;
87
87
  new_clone->recv_size= source->recv_size;
88
88
  new_clone->poll_timeout= source->poll_timeout;
89
+ new_clone->poll_max_retries = source->poll_max_retries;
89
90
  new_clone->connect_timeout= source->connect_timeout;
90
91
  new_clone->retry_timeout= source->retry_timeout;
91
92
  new_clone->distribution= source->distribution;
@@ -85,6 +85,7 @@ struct memcached_st {
85
85
  memcached_server_st *hosts;
86
86
  int32_t snd_timeout;
87
87
  int32_t rcv_timeout;
88
+ int32_t poll_max_retries;
88
89
  uint32_t server_failure_limit;
89
90
  uint32_t io_msg_watermark;
90
91
  uint32_t io_bytes_watermark;
@@ -109,7 +109,7 @@ extern "C"
109
109
  PROTOCOL_BINARY_CMD_TOUCH = 0x1c,
110
110
  PROTOCOL_BINARY_CMD_SASL_LIST_MECHS = 0x20,
111
111
  PROTOCOL_BINARY_CMD_SASL_AUTH = 0x21,
112
- PROTOCOL_BINARY_CMD_SASL_STEP = 0x22,
112
+ PROTOCOL_BINARY_CMD_SASL_STEP = 0x22
113
113
  } protocol_binary_command;
114
114
 
115
115
  /**
@@ -132,6 +132,9 @@ memcached_return memcached_behavior_set(memcached_st *ptr,
132
132
  case MEMCACHED_BEHAVIOR_POLL_TIMEOUT:
133
133
  ptr->poll_timeout= (int32_t)data;
134
134
  break;
135
+ case MEMCACHED_BEHAVIOR_POLL_MAX_RETRIES:
136
+ ptr->poll_max_retries= (uint32_t) data;
137
+ break;
135
138
  case MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT:
136
139
  ptr->connect_timeout= (int32_t)data;
137
140
  break;
@@ -229,6 +232,8 @@ uint64_t memcached_behavior_get(memcached_st *ptr,
229
232
  return (uint64_t)ptr->snd_timeout;
230
233
  case MEMCACHED_BEHAVIOR_RCV_TIMEOUT:
231
234
  return (uint64_t)ptr->rcv_timeout;
235
+ case MEMCACHED_BEHAVIOR_POLL_MAX_RETRIES:
236
+ return (uint64_t)ptr->poll_max_retries;
232
237
  case MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE:
233
238
  {
234
239
  int sock_size;
@@ -85,6 +85,7 @@ typedef enum {
85
85
  MEMCACHED_BEHAVIOR_CACHE_LOOKUPS,
86
86
  MEMCACHED_BEHAVIOR_SUPPORT_CAS,
87
87
  MEMCACHED_BEHAVIOR_POLL_TIMEOUT,
88
+ MEMCACHED_BEHAVIOR_POLL_MAX_RETRIES,
88
89
  MEMCACHED_BEHAVIOR_DISTRIBUTION,
89
90
  MEMCACHED_BEHAVIOR_BUFFER_REQUESTS,
90
91
  MEMCACHED_BEHAVIOR_USER_DATA,
@@ -39,6 +39,8 @@ memcached_return memcached_vdo(memcached_server_st *ptr,
39
39
  {
40
40
  memcached_return rc;
41
41
  ssize_t sent_length;
42
+ size_t command_length;
43
+ uint32_t x;
42
44
 
43
45
  WATCHPOINT_ASSERT(count);
44
46
  WATCHPOINT_ASSERT(vector);
@@ -56,8 +58,8 @@ memcached_return memcached_vdo(memcached_server_st *ptr,
56
58
 
57
59
  sent_length= memcached_io_writev(ptr, vector, count, (char) with_flush);
58
60
 
59
- size_t command_length = 0;
60
- for (uint32_t x= 0; x < count; ++x, vector++)
61
+ command_length = 0;
62
+ for (x= 0; x < count; ++x, vector++)
61
63
  command_length+= vector->length;
62
64
 
63
65
  if (sent_length == -1 || (size_t)sent_length != command_length) {
@@ -17,4 +17,4 @@ memcached_return memcached_exist_by_key(memcached_st *memc,
17
17
  }
18
18
  #endif
19
19
 
20
- #endif /* __MEMCACHED_EXIST_H__ */
20
+ #endif /* __MEMCACHED_EXIST_H__ */
@@ -4,8 +4,9 @@
4
4
  memcached_return memcached_flush_buffers(memcached_st *mem)
5
5
  {
6
6
  memcached_return ret= MEMCACHED_SUCCESS;
7
+ uint32_t x;
7
8
 
8
- for (uint32_t x= 0; x < mem->number_of_hosts; ++x)
9
+ for (x= 0; x < mem->number_of_hosts; ++x)
9
10
  if (mem->hosts[x].write_buffer_offset != 0)
10
11
  {
11
12
  if (mem->hosts[x].fd == -1 &&
@@ -9,7 +9,7 @@
9
9
 
10
10
  typedef enum {
11
11
  MEM_READ,
12
- MEM_WRITE,
12
+ MEM_WRITE
13
13
  } memc_read_or_write;
14
14
 
15
15
  static ssize_t io_flush(memcached_server_st *ptr, memcached_return *error);
@@ -94,6 +94,7 @@ memcached_return memcached_io_read(memcached_server_st *ptr,
94
94
  void *buffer, size_t length, ssize_t *nread)
95
95
  {
96
96
  char *buffer_ptr;
97
+ memcached_return rc;
97
98
 
98
99
  buffer_ptr= buffer;
99
100
 
@@ -111,7 +112,7 @@ memcached_return memcached_io_read(memcached_server_st *ptr,
111
112
  else if (data_read == -1)
112
113
  {
113
114
  ptr->cached_errno= errno;
114
- memcached_return rc= MEMCACHED_UNKNOWN_READ_FAILURE;
115
+ rc= MEMCACHED_UNKNOWN_READ_FAILURE;
115
116
  switch (errno)
116
117
  {
117
118
  case EAGAIN:
@@ -197,7 +198,7 @@ static ssize_t _io_write(memcached_server_st *ptr,
197
198
 
198
199
  if (ptr->type == MEMCACHED_CONNECTION_UDP)
199
200
  {
200
- //UDP does not support partial writes
201
+ /* UDP does not support partial writes */
201
202
  buffer_end= MAX_UDP_DATAGRAM_LENGTH;
202
203
  should_write= length;
203
204
  if (ptr->write_buffer_offset + should_write > buffer_end)
@@ -257,8 +258,9 @@ ssize_t memcached_io_writev(memcached_server_st *ptr,
257
258
  {
258
259
  ssize_t total = 0;
259
260
  char f = (char)false;
261
+ size_t x;
260
262
 
261
- for (size_t x = 0; x < number_of; x++, vector++)
263
+ for (x = 0; x < number_of; x++, vector++)
262
264
  {
263
265
  ssize_t returnable;
264
266
  if ((returnable= _io_write(ptr, vector->buffer, vector->length, f)) == -1)
@@ -308,9 +310,12 @@ memcached_server_st *memcached_io_get_readable_server(memcached_st *memc)
308
310
  {
309
311
  #define MAX_SERVERS_TO_POLL 100
310
312
  struct pollfd fds[MAX_SERVERS_TO_POLL];
311
- unsigned int host_index= 0;
313
+ unsigned int host_index= 0,
314
+ x,
315
+ y;
316
+ int err;
312
317
 
313
- for (unsigned int x= 0;
318
+ for (x= 0;
314
319
  x< memc->number_of_hosts && host_index < MAX_SERVERS_TO_POLL;
315
320
  ++x)
316
321
  {
@@ -329,14 +334,14 @@ memcached_server_st *memcached_io_get_readable_server(memcached_st *memc)
329
334
  if (host_index < 2)
330
335
  {
331
336
  /* We have 0 or 1 server with pending events.. */
332
- for (unsigned int x= 0; x< memc->number_of_hosts; ++x)
337
+ for (x= 0; x< memc->number_of_hosts; ++x)
333
338
  if (memcached_server_response_count(&memc->hosts[x]) > 0)
334
339
  return &memc->hosts[x];
335
340
 
336
341
  return NULL;
337
342
  }
338
343
 
339
- int err= poll(fds, host_index, memc->poll_timeout);
344
+ err= poll(fds, host_index, memc->poll_timeout);
340
345
  switch (err) {
341
346
  case -1:
342
347
  memc->cached_errno = errno;
@@ -344,9 +349,9 @@ memcached_server_st *memcached_io_get_readable_server(memcached_st *memc)
344
349
  case 0:
345
350
  break;
346
351
  default:
347
- for (unsigned int x= 0; x < host_index; ++x)
352
+ for (x= 0; x < host_index; ++x)
348
353
  if (fds[x].revents & POLLIN)
349
- for (unsigned int y= 0; y < memc->number_of_hosts; ++y)
354
+ for (y= 0; y < memc->number_of_hosts; ++y)
350
355
  if (memc->hosts[y].fd == fds[x].fd)
351
356
  return &memc->hosts[y];
352
357
  }
@@ -357,6 +362,12 @@ memcached_server_st *memcached_io_get_readable_server(memcached_st *memc)
357
362
  static ssize_t io_flush(memcached_server_st *ptr,
358
363
  memcached_return *error)
359
364
  {
365
+ ssize_t sent_length;
366
+ size_t return_length;
367
+ char *local_write_ptr;
368
+ size_t write_length;
369
+ int timeout_cnt;
370
+
360
371
  /*
361
372
  ** We might want to purge the input buffer if we haven't consumed
362
373
  ** any output yet... The test for the limits is the purge is inline
@@ -370,16 +381,14 @@ static ssize_t io_flush(memcached_server_st *ptr,
370
381
  if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED)
371
382
  return -1;
372
383
  }
373
- ssize_t sent_length;
374
- size_t return_length;
375
- char *local_write_ptr= ptr->write_buffer;
376
- size_t write_length= ptr->write_buffer_offset;
384
+ local_write_ptr= ptr->write_buffer;
385
+ write_length= ptr->write_buffer_offset;
377
386
 
378
387
  *error= MEMCACHED_SUCCESS;
379
388
 
380
389
  WATCHPOINT_ASSERT(ptr->fd != -1);
381
390
 
382
- // UDP Sanity check, make sure that we are not sending somthing too big
391
+ /* UDP Sanity check, make sure that we are not sending somthing too big */
383
392
  if (ptr->type == MEMCACHED_CONNECTION_UDP && write_length > MAX_UDP_DATAGRAM_LENGTH)
384
393
  return -1;
385
394
 
@@ -395,6 +404,7 @@ static ssize_t io_flush(memcached_server_st *ptr,
395
404
  #endif
396
405
 
397
406
  return_length= 0;
407
+ timeout_cnt = 0;
398
408
  while (write_length)
399
409
  {
400
410
  WATCHPOINT_ASSERT(ptr->fd != -1);
@@ -416,10 +426,15 @@ static ssize_t io_flush(memcached_server_st *ptr,
416
426
  memcached_return rc;
417
427
  rc= io_wait(ptr, MEM_WRITE);
418
428
 
419
- if (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_TIMEOUT)
429
+ if (rc == MEMCACHED_SUCCESS)
420
430
  continue;
431
+ else if (rc == MEMCACHED_TIMEOUT) {
432
+ if((ptr->root->poll_max_retries) && (timeout_cnt++ <= ptr->root->poll_max_retries))
433
+ continue;
434
+ }
421
435
 
422
436
  memcached_quit_server(ptr, 1);
437
+ *error= MEMCACHED_TIMEOUT;
423
438
  return -1;
424
439
  }
425
440
  default:
@@ -444,11 +459,15 @@ static ssize_t io_flush(memcached_server_st *ptr,
444
459
  }
445
460
 
446
461
  WATCHPOINT_ASSERT(write_length == 0);
447
- // Need to study this assert() WATCHPOINT_ASSERT(return_length ==
448
- // ptr->write_buffer_offset);
462
+ /*
463
+ * Need to study this assert() WATCHPOINT_ASSERT(return_length ==
464
+ * ptr->write_buffer_offset);
465
+ */
449
466
 
450
- // if we are a udp server, the begining of the buffer is reserverd for
451
- // the upd frame header
467
+ /*
468
+ * if we are a udp server, the begining of the buffer is reserverd for
469
+ * the upd frame header
470
+ */
452
471
  if (ptr->type == MEMCACHED_CONNECTION_UDP)
453
472
  ptr->write_buffer_offset= UDP_DATAGRAM_HEADER_LENGTH;
454
473
  else
@@ -230,6 +230,7 @@ static test_return clone_test(memcached_st *memc)
230
230
  assert(memc_clone->on_cleanup == memc->on_cleanup);
231
231
  assert(memc_clone->on_clone == memc->on_clone);
232
232
  assert(memc_clone->poll_timeout == memc->poll_timeout);
233
+ assert(memc_clone->poll_max_retries == memc->poll_max_retries);
233
234
  assert(memc_clone->rcv_timeout == memc->rcv_timeout);
234
235
  assert(memc_clone->recv_size == memc->recv_size);
235
236
  assert(memc_clone->retry_timeout == memc->retry_timeout);
@@ -293,7 +294,7 @@ static test_return error_test(memcached_st *memc)
293
294
  1437122909U, 2300930706U, 2943759320U, 674306647U, 2400528935U, 54481931U, 4186304426U, 1741088401U, 2979625118U,
294
295
  4159057246U, 1769812374U, 2302537950U, 1110330676U};
295
296
 
296
- // You have updated the memcache_error messages but not updated docs/tests.
297
+ /* You have updated the memcache_error messages but not updated docs/tests. */
297
298
  assert(MEMCACHED_SUCCESS == 0 && MEMCACHED_MAXIMUM_RETURN == 40);
298
299
  for (rc= MEMCACHED_SUCCESS; rc < MEMCACHED_MAXIMUM_RETURN; rc++)
299
300
  {
@@ -457,6 +458,7 @@ static test_return cas_test(memcached_st *memc)
457
458
  size_t value_length= strlen(value);
458
459
  const char *value2= "change the value";
459
460
  size_t value2_length= strlen(value2);
461
+ uint64_t cas;
460
462
 
461
463
  memcached_result_st results_obj;
462
464
  memcached_result_st *results;
@@ -483,7 +485,7 @@ static test_return cas_test(memcached_st *memc)
483
485
  assert(!memcmp(value, memcached_result_value(results), value_length));
484
486
  assert(strlen(memcached_result_value(results)) == value_length);
485
487
  assert(rc == MEMCACHED_SUCCESS);
486
- uint64_t cas = memcached_result_cas(results);
488
+ cas = memcached_result_cas(results);
487
489
 
488
490
  #if 0
489
491
  results= memcached_fetch_result(memc, &results_obj, &rc);
@@ -514,6 +516,7 @@ static test_return mget_len_no_cas_test(memcached_st *memc)
514
516
  const char *keys[]= {"fudge_for_me", "son_of_bonnie", "food_a_la_carte"};
515
517
  size_t keys_length[]= {12, 13, 15};
516
518
  const unsigned int specified_length = 4;
519
+ char *result_str;
517
520
 
518
521
  memcached_result_st results_obj;
519
522
  memcached_result_st *results;
@@ -565,7 +568,7 @@ static test_return mget_len_no_cas_test(memcached_st *memc)
565
568
  assert(rc == MEMCACHED_SUCCESS);
566
569
  assert(!memcached_result_cas(results));
567
570
 
568
- char *result_str = memcached_result_value(results);
571
+ result_str = memcached_result_value(results);
569
572
  assert(strlen(result_str) == specified_length);
570
573
 
571
574
  x++;
@@ -587,6 +590,11 @@ static test_return mget_len_cas_test(memcached_st *memc)
587
590
  const unsigned int specified_length = 4;
588
591
  const char *value2= "change the value";
589
592
  size_t value2_length= strlen(value2);
593
+ memcached_st *mclone;
594
+ char *result_str;
595
+ uint64_t cas;
596
+ char *key;
597
+ uint32_t key_length;
590
598
 
591
599
  memcached_result_st results_obj;
592
600
  memcached_result_st *results;
@@ -635,7 +643,7 @@ static test_return mget_len_cas_test(memcached_st *memc)
635
643
  * results so clone the memcached_st state and move on with life.
636
644
  * This happens when using memcached_mget() and memcached_mget_len().
637
645
  */
638
- memcached_st *mclone= memcached_clone(NULL, memc);
646
+ mclone= memcached_clone(NULL, memc);
639
647
 
640
648
  x = 0;
641
649
  while ((results= memcached_fetch_result(memc, &results_obj, &rc)))
@@ -644,14 +652,14 @@ static test_return mget_len_cas_test(memcached_st *memc)
644
652
  assert(&results_obj == results);
645
653
  assert(rc == MEMCACHED_SUCCESS);
646
654
 
647
- char *result_str = memcached_result_value(results);
655
+ result_str = memcached_result_value(results);
648
656
  assert(strlen(result_str) == specified_length);
649
657
 
650
658
  assert(memcached_result_cas(results));
651
659
 
652
- uint64_t cas = memcached_result_cas(results);
653
- char *key = memcached_result_key_value(results);
654
- uint32_t key_length = memcached_result_key_length(results);
660
+ cas = memcached_result_cas(results);
661
+ key = memcached_result_key_value(results);
662
+ key_length = memcached_result_key_length(results);
655
663
  rc= memcached_cas(mclone, key, key_length, value2, value2_length, 0, 0, cas);
656
664
 
657
665
  /*
@@ -836,6 +844,7 @@ static test_return bad_key_test(memcached_st *memc)
836
844
  memcached_st *memc_clone;
837
845
  unsigned int set= 1;
838
846
  size_t max_keylen= 0xffff;
847
+ const char *keys[] = { "GoodKey", "Bad Key", "NotMine" };
839
848
 
840
849
  memc_clone= memcached_clone(NULL, memc);
841
850
  assert(memc_clone);
@@ -862,7 +871,6 @@ static test_return bad_key_test(memcached_st *memc)
862
871
  assert(!string);
863
872
 
864
873
  /* Test multi key for bad keys */
865
- const char *keys[] = { "GoodKey", "Bad Key", "NotMine" };
866
874
  size_t key_lengths[] = { 7, 7, 7 };
867
875
  set= 1;
868
876
  rc= memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_VERIFY_KEY, set);
@@ -2816,6 +2824,7 @@ static test_return user_supplied_bug18(memcached_st *trash)
2816
2824
  static test_return auto_eject_hosts(memcached_st *trash)
2817
2825
  {
2818
2826
  (void) trash;
2827
+ int x;
2819
2828
 
2820
2829
  memcached_return rc;
2821
2830
  memcached_st *memc= memcached_create(NULL);
@@ -2859,7 +2868,7 @@ static test_return auto_eject_hosts(memcached_st *trash)
2859
2868
  memc->hosts[2].next_retry = time(NULL) + 15;
2860
2869
  memc->next_distribution_rebuild= time(NULL) - 1;
2861
2870
 
2862
- for (int x= 0; x < 99; x++)
2871
+ for (x= 0; x < 99; x++)
2863
2872
  {
2864
2873
  uint32_t server_idx = memcached_generate_hash(memc, test_cases[x].key, strlen(test_cases[x].key));
2865
2874
  assert(server_idx != 2);
@@ -2869,7 +2878,7 @@ static test_return auto_eject_hosts(memcached_st *trash)
2869
2878
  memc->hosts[2].next_retry = time(NULL) - 1;
2870
2879
  memc->next_distribution_rebuild= time(NULL) - 1;
2871
2880
  run_distribution(memc);
2872
- for (int x= 0; x < 99; x++)
2881
+ for (x= 0; x < 99; x++)
2873
2882
  {
2874
2883
  uint32_t server_idx = memcached_generate_hash(memc, test_cases[x].key, strlen(test_cases[x].key));
2875
2884
  char *hostname = memc->hosts[server_idx].hostname;
@@ -3681,6 +3690,8 @@ static memcached_return poll_timeout(memcached_st *memc)
3681
3690
 
3682
3691
  static test_return noreply_test(memcached_st *memc)
3683
3692
  {
3693
+ int count, x;
3694
+ uint32_t y;
3684
3695
  memcached_return ret;
3685
3696
  ret= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NOREPLY, 1);
3686
3697
  assert(ret == MEMCACHED_SUCCESS);
@@ -3692,9 +3703,9 @@ static test_return noreply_test(memcached_st *memc)
3692
3703
  assert(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS) == 1);
3693
3704
  assert(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_SUPPORT_CAS) == 1);
3694
3705
 
3695
- for (int count=0; count < 5; ++count)
3706
+ for (count=0; count < 5; ++count)
3696
3707
  {
3697
- for (int x=0; x < 100; ++x)
3708
+ for (x=0; x < 100; ++x)
3698
3709
  {
3699
3710
  char key[10];
3700
3711
  size_t len= (size_t)sprintf(key, "%d", x);
@@ -3728,8 +3739,8 @@ static test_return noreply_test(memcached_st *memc)
3728
3739
  ** way it is supposed to do!!!!
3729
3740
  */
3730
3741
  int no_msg=0;
3731
- for (uint32_t x=0; x < memc->number_of_hosts; ++x)
3732
- no_msg+=(int)(memc->hosts[x].cursor_active);
3742
+ for (y=0; x < memc->number_of_hosts; ++y)
3743
+ no_msg+=(int)(memc->hosts[y].cursor_active);
3733
3744
 
3734
3745
  assert(no_msg == 0);
3735
3746
  assert(memcached_flush_buffers(memc) == MEMCACHED_SUCCESS);
@@ -3737,7 +3748,7 @@ static test_return noreply_test(memcached_st *memc)
3737
3748
  /*
3738
3749
  ** Now validate that all items was set properly!
3739
3750
  */
3740
- for (int x=0; x < 100; ++x)
3751
+ for (x=0; x < 100; ++x)
3741
3752
  {
3742
3753
  char key[10];
3743
3754
  size_t len= (size_t)sprintf(key, "%d", x);
@@ -216,6 +216,7 @@ VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, u
216
216
  VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
217
217
  size_t value_length = 0;
218
218
  VALUE ary = rb_ary_new();
219
+ *key_length = 0;
219
220
  if (error) *error = MEMCACHED_TIMEOUT; // timeouts leave error uninitialized
220
221
  char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
221
222
  VALUE str = rb_str_new_by_ref(value, value_length);
@@ -2301,6 +2301,7 @@ VALUE memcached_get_from_last_rvalue(memcached_st *ptr, const char *key, size_t
2301
2301
  VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
2302
2302
  size_t value_length = 0;
2303
2303
  VALUE ary = rb_ary_new();
2304
+ *key_length = 0;
2304
2305
  if (error) *error = MEMCACHED_TIMEOUT; // timeouts leave error uninitialized
2305
2306
  char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
2306
2307
  VALUE str = rb_str_new_by_ref(value, value_length);
@@ -13725,6 +13726,7 @@ SWIGEXPORT void Init_rlibmemcached(void) {
13725
13726
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_CACHE_LOOKUPS", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_CACHE_LOOKUPS)));
13726
13727
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_SUPPORT_CAS", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_SUPPORT_CAS)));
13727
13728
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_POLL_TIMEOUT", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_POLL_TIMEOUT)));
13729
+ rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_POLL_MAX_RETRIES", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_POLL_MAX_RETRIES)));
13728
13730
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_DISTRIBUTION", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_DISTRIBUTION)));
13729
13731
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_BUFFER_REQUESTS", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_BUFFER_REQUESTS)));
13730
13732
  rb_define_const(mRlibmemcached, "MEMCACHED_BEHAVIOR_USER_DATA", SWIG_From_int((int)(MEMCACHED_BEHAVIOR_USER_DATA)));
@@ -23,10 +23,11 @@ class Memcached
23
23
  DISTRIBUTION_VALUES = {}
24
24
  BEHAVIOR_VALUES.merge!(load_constants("MEMCACHED_DISTRIBUTION_", DISTRIBUTION_VALUES))
25
25
 
26
- DIRECT_VALUE_BEHAVIORS = [:retry_timeout, :connect_timeout, :rcv_timeout, :socket_recv_size, :poll_timeout, :socket_send_size, :server_failure_limit]
26
+ DIRECT_VALUE_BEHAVIORS = [:retry_timeout, :connect_timeout, :rcv_timeout, :socket_recv_size, :poll_timeout, :socket_send_size, :server_failure_limit, :snd_timeout, :poll_max_retries]
27
27
 
28
28
  CONVERSION_FACTORS = {
29
29
  :rcv_timeout => 1_000_000,
30
+ :snd_timeout => 1_000_000,
30
31
  :poll_timeout => 1_000,
31
32
  :connect_timeout => 1_000
32
33
  }
@@ -18,6 +18,8 @@ class Memcached
18
18
  :retry_timeout => 60,
19
19
  :timeout => 0.25,
20
20
  :rcv_timeout => nil,
21
+ :snd_timeout => nil,
22
+ :poll_max_retries => 1,
21
23
  :poll_timeout => nil,
22
24
  :connect_timeout => 0.25,
23
25
  :prefix_key => '',
@@ -97,6 +99,7 @@ Valid option parameters are:
97
99
  <tt>:binary_protocol</tt>:: Use the binary protocol. Defaults to false. Please note that using the binary protocol is usually <b>slower</b> than the ASCII protocol.
98
100
  <tt>:sort_hosts</tt>:: Whether to force the server list to stay sorted. This defeats consistent hashing and is rarely useful.
99
101
  <tt>:verify_key</tt>:: Validate keys before accepting them. Never disable this.
102
+ <tt>:poll_max_retries</tt>:: Maximum poll timeout retries before marking a flush failed on timeouts.
100
103
 
101
104
  Please note that when <tt>:no_block => true</tt>, update methods do not raise on errors. For example, if you try to <tt>set</tt> an invalid key, it will appear to succeed. The actual setting of the key occurs after libmemcached has returned control to your program, so there is no way to backtrack and raise the exception.
102
105
 
@@ -107,7 +110,11 @@ Please note that when <tt>:no_block => true</tt>, update methods do not raise on
107
110
 
108
111
  # Merge option defaults and discard meaningless keys
109
112
  @options = DEFAULTS.merge(opts)
110
- @options.delete_if { |k,v| not DEFAULTS.keys.include? k }
113
+ @options.each do |key,_|
114
+ unless DEFAULTS.keys.include? key
115
+ raise ArgumentError, "#{key.inspect} is not a valid configuration parameter."
116
+ end
117
+ end
111
118
 
112
119
  # Marginally speed up settings access for hot paths
113
120
  @default_ttl = options[:default_ttl]
@@ -149,8 +156,11 @@ Please note that when <tt>:no_block => true</tt>, update methods do not raise on
149
156
  options[:rcv_timeout] ||= options[:timeout]
150
157
  options[:poll_timeout] ||= options[:timeout]
151
158
 
152
- # Set the prefix key. Support the legacy name.
153
- set_prefix_key(options[:prefix_key] || options[:namespace])
159
+ # Write timeouts
160
+ options[:snd_timeout] ||= options[:timeout]
161
+
162
+ # Set the prefix key
163
+ set_prefix_key(options[:prefix_key])
154
164
 
155
165
  # Set the behaviors and credentials on the struct
156
166
  set_behaviors
@@ -221,7 +231,6 @@ Please note that when <tt>:no_block => true</tt>, update methods do not raise on
221
231
  end
222
232
  )
223
233
  end
224
- alias :set_namespace :set_prefix_key
225
234
 
226
235
  # Return the current prefix key.
227
236
  def prefix_key
@@ -231,7 +240,6 @@ Please note that when <tt>:no_block => true</tt>, update methods do not raise on
231
240
  ""
232
241
  end
233
242
  end
234
- alias :namespace :prefix_key
235
243
 
236
244
  # Safely copy this instance. Returns a Memcached instance.
237
245
  #
@@ -25,11 +25,11 @@ class Memcached
25
25
  args.any? ? args.unshift : opts.delete(:servers)
26
26
  ).flatten.compact
27
27
 
28
- opts[:prefix_key] = opts[:namespace] if opts[:namespace]
29
- opts[:prefix_delimiter] = opts[:namespace_separator] if opts[:namespace_separator]
28
+ opts[:prefix_key] = opts.delete(:namespace) if opts[:namespace]
29
+ opts[:prefix_delimiter] = opts.delete(:namespace_separator) if opts[:namespace_separator]
30
30
 
31
- @logger = opts[:logger]
32
- @string_return_types = opts[:string_return_types]
31
+ @logger = opts.delete(:logger)
32
+ @string_return_types = opts.delete(:string_return_types)
33
33
 
34
34
  logger.info { "memcached #{VERSION} #{servers.inspect}" } if logger
35
35
  super(servers, opts)
@@ -39,22 +39,40 @@ class Memcached
39
39
  @logger = logger
40
40
  end
41
41
 
42
+ def namespace
43
+ @options[:prefix_key]
44
+ end
45
+
42
46
  # Check if there are any servers defined?
43
47
  def active?
44
48
  servers.any?
45
49
  end
46
50
 
51
+ def log_exception(e)
52
+ logger.warn("memcached error: #{e.class}: #{e.message}") if logger
53
+ false
54
+ end
55
+
47
56
  # Wraps Memcached#get so that it doesn't raise. This has the side-effect of preventing you from
48
57
  # storing <tt>nil</tt> values.
49
58
  def get(key, raw=false)
50
59
  super(key, !raw)
51
60
  rescue NotFound
61
+ rescue Error => e
62
+ log_exception e
52
63
  end
53
64
 
54
65
  # Alternative to #get. Accepts a key and an optional options hash supporting the single option
55
66
  # :raw.
56
- def read(key, options = {})
57
- get(key, options[:raw])
67
+ def read(key, options = nil)
68
+ if options
69
+ get(key, options[:raw])
70
+ else
71
+ get(key)
72
+ end
73
+ rescue NotFound
74
+ rescue Error => e
75
+ log_exception e
58
76
  end
59
77
 
60
78
  # Returns whether the key exists, even if the value is nil.
@@ -63,6 +81,8 @@ class Memcached
63
81
  true
64
82
  rescue NotFound
65
83
  false
84
+ rescue Error => e
85
+ log_exception e
66
86
  end
67
87
 
68
88
  # Wraps Memcached#cas so that it doesn't raise. Doesn't set anything if no value is present.
@@ -74,6 +94,8 @@ class Memcached
74
94
  ttl = ttl.value and retry rescue raise e
75
95
  rescue NotFound, ConnectionDataExists
76
96
  false
97
+ rescue Error => e
98
+ log_exception e
77
99
  end
78
100
 
79
101
  alias :compare_and_swap :cas
@@ -81,6 +103,9 @@ class Memcached
81
103
  # Wraps Memcached#get.
82
104
  def get_multi(keys, raw=false)
83
105
  get_orig(keys, !raw)
106
+ rescue NotFound
107
+ rescue Error => e
108
+ log_exception e
84
109
  end
85
110
 
86
111
  # Wraps Memcached#set.
@@ -92,20 +117,33 @@ class Memcached
92
117
  ttl = ttl.value and retry rescue raise e
93
118
  rescue NotStored
94
119
  false
120
+ rescue Error => e
121
+ log_exception e
95
122
  end
96
123
 
97
124
  # Alternative to #set. Accepts a key, value, and an optional options hash supporting the
98
125
  # options :raw and :ttl.
99
- def write(key, value, options = {})
100
- set(key, value, options[:ttl] || options[:expires_in] || @default_ttl, options[:raw])
126
+ def write(key, value, options = nil)
127
+ value = value.to_s if options && options[:raw]
128
+ ttl = options ? (options[:ttl] || options[:expires_in] || @default_ttl) : @default_ttl
129
+ raw = options ? options[:raw] : nil
130
+ if options && options[:unless_exist]
131
+ add(key, value, ttl, raw)
132
+ else
133
+ set(key, value, ttl, raw)
134
+ end
101
135
  end
102
136
 
103
- def fetch(key, options={})
137
+ def fetch(key, options = nil)
104
138
  result = read(key, options)
105
139
  if result.nil?
106
- result = yield
107
- write(key, result, options)
108
- result
140
+ if block_given?
141
+ result = yield
142
+ write(key, result, options)
143
+ result
144
+ else
145
+ result
146
+ end
109
147
  else
110
148
  result
111
149
  end
@@ -119,37 +157,49 @@ class Memcached
119
157
  # Maybe we got an ActiveSupport::Duration
120
158
  ttl = ttl.value and retry rescue raise e
121
159
  rescue NotStored
160
+ rescue Error => e
161
+ log_exception e
122
162
  @string_return_types? "NOT STORED\r\n" : false
123
163
  end
124
164
 
125
165
  # Wraps Memcached#delete so that it doesn't raise.
126
- def delete(key, expiry=0)
166
+ def delete(key, options = nil)
127
167
  super(key)
128
168
  rescue NotFound
169
+ rescue Error => e
170
+ log_exception e
129
171
  end
130
172
 
131
173
  # Wraps Memcached#incr so that it doesn't raise.
132
174
  def incr(*args)
133
175
  super
134
176
  rescue NotFound
177
+ rescue Error => e
178
+ log_exception e
135
179
  end
136
180
 
137
181
  # Wraps Memcached#decr so that it doesn't raise.
138
182
  def decr(*args)
139
183
  super
140
184
  rescue NotFound
185
+ rescue Error => e
186
+ log_exception e
141
187
  end
142
188
 
143
189
  # Wraps Memcached#append so that it doesn't raise.
144
190
  def append(*args)
145
191
  super
146
192
  rescue NotStored
193
+ rescue Error => e
194
+ log_exception e
147
195
  end
148
196
 
149
197
  # Wraps Memcached#prepend so that it doesn't raise.
150
198
  def prepend(*args)
151
199
  super
152
200
  rescue NotStored
201
+ rescue Error => e
202
+ log_exception e
153
203
  end
154
204
 
155
205
  alias :flush_all :flush
@@ -180,5 +230,19 @@ class Memcached
180
230
  end
181
231
  super
182
232
  end
233
+
234
+ def increment(name, amount = 1, options = nil)
235
+ response = super(name, amount)
236
+ response ? response.to_i : nil
237
+ rescue
238
+ nil
239
+ end
240
+
241
+ def decrement(name, amount = 1, options = nil)
242
+ response = super(name, amount)
243
+ response ? response.to_i : nil
244
+ rescue
245
+ nil
246
+ end
183
247
  end
184
248
  end
@@ -2,28 +2,28 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "memcached"
5
- s.version = "1.6.1"
5
+ s.version = "1.7.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
- s.cert_chain = ["/Users/eweaver/cloudburst/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
- s.date = "2013-06-11"
9
+ s.cert_chain = ["/Users/eweaver/cloudburst/github/memcached/memcached.pem"]
10
+ s.date = "2013-08-09"
11
11
  s.description = "An interface to the libmemcached C client."
12
12
  s.email = ""
13
13
  s.extensions = ["ext/extconf.rb"]
14
14
  s.extra_rdoc_files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "README.rdoc", "TODO", "ext/libmemcached-0.32/README", "ext/libmemcached-0.32/TODO", "ext/libmemcached-0.32/libmemcached/memcached/README.txt", "lib/memcached.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb"]
15
- s.files = ["BENCHMARKS", "CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "TODO", "ext/extconf-make.rb", "ext/extconf.rb", "ext/libmemcached-0.32/AUTHORS", "ext/libmemcached-0.32/COPYING", "ext/libmemcached-0.32/ChangeLog", "ext/libmemcached-0.32/INSTALL", "ext/libmemcached-0.32/Makefile.am", "ext/libmemcached-0.32/Makefile.in", "ext/libmemcached-0.32/NEWS", "ext/libmemcached-0.32/README", "ext/libmemcached-0.32/THANKS", "ext/libmemcached-0.32/TODO", "ext/libmemcached-0.32/aclocal.m4", "ext/libmemcached-0.32/clients/Makefile.am", "ext/libmemcached-0.32/clients/Makefile.in", "ext/libmemcached-0.32/clients/client_options.h", "ext/libmemcached-0.32/clients/execute.c", "ext/libmemcached-0.32/clients/execute.h", "ext/libmemcached-0.32/clients/generator.c", "ext/libmemcached-0.32/clients/generator.h", "ext/libmemcached-0.32/clients/memcat.c", "ext/libmemcached-0.32/clients/memcp.c", "ext/libmemcached-0.32/clients/memdump.c", "ext/libmemcached-0.32/clients/memerror.c", "ext/libmemcached-0.32/clients/memflush.c", "ext/libmemcached-0.32/clients/memrm.c", "ext/libmemcached-0.32/clients/memslap.c", "ext/libmemcached-0.32/clients/memstat.c", "ext/libmemcached-0.32/clients/utilities.c", "ext/libmemcached-0.32/clients/utilities.h", "ext/libmemcached-0.32/config.h.in", "ext/libmemcached-0.32/config/compile", "ext/libmemcached-0.32/config/config.guess", "ext/libmemcached-0.32/config/config.rpath", "ext/libmemcached-0.32/config/config.sub", "ext/libmemcached-0.32/config/depcomp", "ext/libmemcached-0.32/config/install-sh", "ext/libmemcached-0.32/config/ltmain.sh", "ext/libmemcached-0.32/config/missing", "ext/libmemcached-0.32/configure", "ext/libmemcached-0.32/configure.ac", "ext/libmemcached-0.32/docs/Makefile.am", "ext/libmemcached-0.32/docs/Makefile.in", "ext/libmemcached-0.32/docs/libmemcached.pod", "ext/libmemcached-0.32/docs/libmemcached_examples.pod", "ext/libmemcached-0.32/docs/libmemcachedutil.pod", "ext/libmemcached-0.32/docs/memcached_analyze.pod", "ext/libmemcached-0.32/docs/memcached_auto.pod", "ext/libmemcached-0.32/docs/memcached_behavior.pod", "ext/libmemcached-0.32/docs/memcached_callback.pod", "ext/libmemcached-0.32/docs/memcached_create.pod", "ext/libmemcached-0.32/docs/memcached_delete.pod", "ext/libmemcached-0.32/docs/memcached_dump.pod", "ext/libmemcached-0.32/docs/memcached_flush.pod", "ext/libmemcached-0.32/docs/memcached_flush_buffers.pod", "ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod", "ext/libmemcached-0.32/docs/memcached_get.pod", "ext/libmemcached-0.32/docs/memcached_memory_allocators.pod", "ext/libmemcached-0.32/docs/memcached_pool.pod", "ext/libmemcached-0.32/docs/memcached_quit.pod", "ext/libmemcached-0.32/docs/memcached_sasl.pod", "ext/libmemcached-0.32/docs/memcached_server_st.pod", "ext/libmemcached-0.32/docs/memcached_servers.pod", "ext/libmemcached-0.32/docs/memcached_set.pod", "ext/libmemcached-0.32/docs/memcached_stats.pod", "ext/libmemcached-0.32/docs/memcached_strerror.pod", "ext/libmemcached-0.32/docs/memcached_user_data.pod", "ext/libmemcached-0.32/docs/memcached_verbosity.pod", "ext/libmemcached-0.32/docs/memcached_version.pod", "ext/libmemcached-0.32/docs/memcat.pod", "ext/libmemcached-0.32/docs/memcp.pod", "ext/libmemcached-0.32/docs/memdump.pod", "ext/libmemcached-0.32/docs/memerror.pod", "ext/libmemcached-0.32/docs/memflush.pod", "ext/libmemcached-0.32/docs/memrm.pod", "ext/libmemcached-0.32/docs/memslap.pod", "ext/libmemcached-0.32/docs/memstat.pod", "ext/libmemcached-0.32/libmemcached/Makefile.am", "ext/libmemcached-0.32/libmemcached/Makefile.in", "ext/libmemcached-0.32/libmemcached/byteorder.c", "ext/libmemcached-0.32/libmemcached/common.h", "ext/libmemcached-0.32/libmemcached/crc.c", "ext/libmemcached-0.32/libmemcached/hsieh_hash.c", "ext/libmemcached-0.32/libmemcached/jenkins_hash.c", "ext/libmemcached-0.32/libmemcached/libmemcached.ver", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.d", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.h", "ext/libmemcached-0.32/libmemcached/md5.c", "ext/libmemcached-0.32/libmemcached/memcached.c", "ext/libmemcached-0.32/libmemcached/memcached.h", "ext/libmemcached-0.32/libmemcached/memcached.hpp", "ext/libmemcached-0.32/libmemcached/memcached/README.txt", "ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h", "ext/libmemcached-0.32/libmemcached/memcached_allocators.c", "ext/libmemcached-0.32/libmemcached/memcached_analyze.c", "ext/libmemcached-0.32/libmemcached/memcached_auto.c", "ext/libmemcached-0.32/libmemcached/memcached_behavior.c", "ext/libmemcached-0.32/libmemcached/memcached_callback.c", "ext/libmemcached-0.32/libmemcached/memcached_configure.h.in", "ext/libmemcached-0.32/libmemcached/memcached_connect.c", "ext/libmemcached-0.32/libmemcached/memcached_constants.h", "ext/libmemcached-0.32/libmemcached/memcached_delete.c", "ext/libmemcached-0.32/libmemcached/memcached_do.c", "ext/libmemcached-0.32/libmemcached/memcached_dump.c", "ext/libmemcached-0.32/libmemcached/memcached_exist.c", "ext/libmemcached-0.32/libmemcached/memcached_exist.h", "ext/libmemcached-0.32/libmemcached/memcached_fetch.c", "ext/libmemcached-0.32/libmemcached/memcached_flush.c", "ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c", "ext/libmemcached-0.32/libmemcached/memcached_get.c", "ext/libmemcached-0.32/libmemcached/memcached_get.h", "ext/libmemcached-0.32/libmemcached/memcached_hash.c", "ext/libmemcached-0.32/libmemcached/memcached_hosts.c", "ext/libmemcached-0.32/libmemcached/memcached_internal.h", "ext/libmemcached-0.32/libmemcached/memcached_io.c", "ext/libmemcached-0.32/libmemcached/memcached_io.h", "ext/libmemcached-0.32/libmemcached/memcached_key.c", "ext/libmemcached-0.32/libmemcached/memcached_parse.c", "ext/libmemcached-0.32/libmemcached/memcached_pool.h", "ext/libmemcached-0.32/libmemcached/memcached_purge.c", "ext/libmemcached-0.32/libmemcached/memcached_quit.c", "ext/libmemcached-0.32/libmemcached/memcached_response.c", "ext/libmemcached-0.32/libmemcached/memcached_result.c", "ext/libmemcached-0.32/libmemcached/memcached_result.h", "ext/libmemcached-0.32/libmemcached/memcached_sasl.c", "ext/libmemcached-0.32/libmemcached/memcached_sasl.h", "ext/libmemcached-0.32/libmemcached/memcached_server.c", "ext/libmemcached-0.32/libmemcached/memcached_server.h", "ext/libmemcached-0.32/libmemcached/memcached_stats.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.h", "ext/libmemcached-0.32/libmemcached/memcached_strerror.c", "ext/libmemcached-0.32/libmemcached/memcached_string.c", "ext/libmemcached-0.32/libmemcached/memcached_string.h", "ext/libmemcached-0.32/libmemcached/memcached_touch.c", "ext/libmemcached-0.32/libmemcached/memcached_touch.h", "ext/libmemcached-0.32/libmemcached/memcached_types.h", "ext/libmemcached-0.32/libmemcached/memcached_util.h", "ext/libmemcached-0.32/libmemcached/memcached_verbosity.c", "ext/libmemcached-0.32/libmemcached/memcached_version.c", "ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h", "ext/libmemcached-0.32/libmemcached/murmur_hash.c", "ext/libmemcached-0.32/libmemcached/visibility.h", "ext/libmemcached-0.32/libmemcachedutil/Makefile.am", "ext/libmemcached-0.32/libmemcachedutil/Makefile.in", "ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver", "ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c", "ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4", "ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4", "ext/libmemcached-0.32/m4/acx_pthread.m4", "ext/libmemcached-0.32/m4/byteorder.m4", "ext/libmemcached-0.32/m4/deprecated.m4", "ext/libmemcached-0.32/m4/enable_utillib.m4", "ext/libmemcached-0.32/m4/extensions.m4", "ext/libmemcached-0.32/m4/hsieh.m4", "ext/libmemcached-0.32/m4/lib-prefix.m4", "ext/libmemcached-0.32/m4/libtool.m4", "ext/libmemcached-0.32/m4/ltoptions.m4", "ext/libmemcached-0.32/m4/ltsugar.m4", "ext/libmemcached-0.32/m4/ltversion.m4", "ext/libmemcached-0.32/m4/lt~obsolete.m4", "ext/libmemcached-0.32/m4/memcached.m4", "ext/libmemcached-0.32/m4/pandora_64bit.m4", "ext/libmemcached-0.32/m4/pandora_canonical.m4", "ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4", "ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4", "ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4", "ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4", "ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4", "ext/libmemcached-0.32/m4/pandora_have_sasl.m4", "ext/libmemcached-0.32/m4/pandora_header_assert.m4", "ext/libmemcached-0.32/m4/pandora_libtool.m4", "ext/libmemcached-0.32/m4/pandora_optimize.m4", "ext/libmemcached-0.32/m4/pandora_shared_ptr.m4", "ext/libmemcached-0.32/m4/pandora_vc_build.m4", "ext/libmemcached-0.32/m4/pandora_warnings.m4", "ext/libmemcached-0.32/m4/pod2man.m4", "ext/libmemcached-0.32/m4/protocol_binary.m4", "ext/libmemcached-0.32/m4/setsockopt.m4", "ext/libmemcached-0.32/m4/visibility.m4", "ext/libmemcached-0.32/support/Makefile.am", "ext/libmemcached-0.32/support/Makefile.in", "ext/libmemcached-0.32/support/libmemcached-fc.spec.in", "ext/libmemcached-0.32/support/libmemcached.pc.in", "ext/libmemcached-0.32/support/libmemcached.spec", "ext/libmemcached-0.32/support/libmemcached.spec.in", "ext/libmemcached-0.32/support/set_benchmark.sh", "ext/libmemcached-0.32/tests/Makefile.am", "ext/libmemcached-0.32/tests/Makefile.in", "ext/libmemcached-0.32/tests/atomsmasher.c", "ext/libmemcached-0.32/tests/function.c", "ext/libmemcached-0.32/tests/ketama_test_cases.h", "ext/libmemcached-0.32/tests/output.cmp", "ext/libmemcached-0.32/tests/output.res", "ext/libmemcached-0.32/tests/output2.res", "ext/libmemcached-0.32/tests/plus.cpp", "ext/libmemcached-0.32/tests/r/memcat.res", "ext/libmemcached-0.32/tests/r/memcp.res", "ext/libmemcached-0.32/tests/r/memrm.res", "ext/libmemcached-0.32/tests/r/memslap.res", "ext/libmemcached-0.32/tests/r/memstat.res", "ext/libmemcached-0.32/tests/server.c", "ext/libmemcached-0.32/tests/server.h", "ext/libmemcached-0.32/tests/start.c", "ext/libmemcached-0.32/tests/t/memcat.test", "ext/libmemcached-0.32/tests/t/memcp.test", "ext/libmemcached-0.32/tests/t/memrm.test", "ext/libmemcached-0.32/tests/t/memslap.test", "ext/libmemcached-0.32/tests/t/memstat.test", "ext/libmemcached-0.32/tests/test.c", "ext/libmemcached-0.32/tests/test.h", "ext/libmemcached-0.32/tests/udp.c", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/marshal_codec.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "memcached.gemspec", "test/profile/benchmark.rb", "test/profile/c_profiler.rb", "test/profile/exercise.rb", "test/profile/rb_profiler.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"]
15
+ s.files = ["BENCHMARKS", "CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.rdoc", "Rakefile", "TODO", "ext/extconf-make.rb", "ext/extconf.rb", "ext/libmemcached-0.32/AUTHORS", "ext/libmemcached-0.32/COPYING", "ext/libmemcached-0.32/ChangeLog", "ext/libmemcached-0.32/INSTALL", "ext/libmemcached-0.32/Makefile.am", "ext/libmemcached-0.32/Makefile.in", "ext/libmemcached-0.32/NEWS", "ext/libmemcached-0.32/README", "ext/libmemcached-0.32/THANKS", "ext/libmemcached-0.32/TODO", "ext/libmemcached-0.32/aclocal.m4", "ext/libmemcached-0.32/clients/Makefile.am", "ext/libmemcached-0.32/clients/Makefile.in", "ext/libmemcached-0.32/clients/client_options.h", "ext/libmemcached-0.32/clients/execute.c", "ext/libmemcached-0.32/clients/execute.h", "ext/libmemcached-0.32/clients/generator.c", "ext/libmemcached-0.32/clients/generator.h", "ext/libmemcached-0.32/clients/memcat.c", "ext/libmemcached-0.32/clients/memcp.c", "ext/libmemcached-0.32/clients/memdump.c", "ext/libmemcached-0.32/clients/memerror.c", "ext/libmemcached-0.32/clients/memflush.c", "ext/libmemcached-0.32/clients/memrm.c", "ext/libmemcached-0.32/clients/memslap.c", "ext/libmemcached-0.32/clients/memstat.c", "ext/libmemcached-0.32/clients/utilities.c", "ext/libmemcached-0.32/clients/utilities.h", "ext/libmemcached-0.32/config.h.in", "ext/libmemcached-0.32/config/compile", "ext/libmemcached-0.32/config/config.guess", "ext/libmemcached-0.32/config/config.rpath", "ext/libmemcached-0.32/config/config.sub", "ext/libmemcached-0.32/config/depcomp", "ext/libmemcached-0.32/config/install-sh", "ext/libmemcached-0.32/config/ltmain.sh", "ext/libmemcached-0.32/config/missing", "ext/libmemcached-0.32/configure", "ext/libmemcached-0.32/configure.ac", "ext/libmemcached-0.32/docs/Makefile.am", "ext/libmemcached-0.32/docs/Makefile.in", "ext/libmemcached-0.32/docs/libmemcached.pod", "ext/libmemcached-0.32/docs/libmemcached_examples.pod", "ext/libmemcached-0.32/docs/libmemcachedutil.pod", "ext/libmemcached-0.32/docs/memcached_analyze.pod", "ext/libmemcached-0.32/docs/memcached_auto.pod", "ext/libmemcached-0.32/docs/memcached_behavior.pod", "ext/libmemcached-0.32/docs/memcached_callback.pod", "ext/libmemcached-0.32/docs/memcached_create.pod", "ext/libmemcached-0.32/docs/memcached_delete.pod", "ext/libmemcached-0.32/docs/memcached_dump.pod", "ext/libmemcached-0.32/docs/memcached_flush.pod", "ext/libmemcached-0.32/docs/memcached_flush_buffers.pod", "ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod", "ext/libmemcached-0.32/docs/memcached_get.pod", "ext/libmemcached-0.32/docs/memcached_memory_allocators.pod", "ext/libmemcached-0.32/docs/memcached_pool.pod", "ext/libmemcached-0.32/docs/memcached_quit.pod", "ext/libmemcached-0.32/docs/memcached_sasl.pod", "ext/libmemcached-0.32/docs/memcached_server_st.pod", "ext/libmemcached-0.32/docs/memcached_servers.pod", "ext/libmemcached-0.32/docs/memcached_set.pod", "ext/libmemcached-0.32/docs/memcached_stats.pod", "ext/libmemcached-0.32/docs/memcached_strerror.pod", "ext/libmemcached-0.32/docs/memcached_user_data.pod", "ext/libmemcached-0.32/docs/memcached_verbosity.pod", "ext/libmemcached-0.32/docs/memcached_version.pod", "ext/libmemcached-0.32/docs/memcat.pod", "ext/libmemcached-0.32/docs/memcp.pod", "ext/libmemcached-0.32/docs/memdump.pod", "ext/libmemcached-0.32/docs/memerror.pod", "ext/libmemcached-0.32/docs/memflush.pod", "ext/libmemcached-0.32/docs/memrm.pod", "ext/libmemcached-0.32/docs/memslap.pod", "ext/libmemcached-0.32/docs/memstat.pod", "ext/libmemcached-0.32/libmemcached/Makefile.am", "ext/libmemcached-0.32/libmemcached/Makefile.in", "ext/libmemcached-0.32/libmemcached/byteorder.c", "ext/libmemcached-0.32/libmemcached/common.h", "ext/libmemcached-0.32/libmemcached/crc.c", "ext/libmemcached-0.32/libmemcached/hsieh_hash.c", "ext/libmemcached-0.32/libmemcached/jenkins_hash.c", "ext/libmemcached-0.32/libmemcached/libmemcached.ver", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.d", "ext/libmemcached-0.32/libmemcached/libmemcached_probes.h", "ext/libmemcached-0.32/libmemcached/md5.c", "ext/libmemcached-0.32/libmemcached/memcached.c", "ext/libmemcached-0.32/libmemcached/memcached.h", "ext/libmemcached-0.32/libmemcached/memcached.hpp", "ext/libmemcached-0.32/libmemcached/memcached/README.txt", "ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h", "ext/libmemcached-0.32/libmemcached/memcached_allocators.c", "ext/libmemcached-0.32/libmemcached/memcached_analyze.c", "ext/libmemcached-0.32/libmemcached/memcached_auto.c", "ext/libmemcached-0.32/libmemcached/memcached_behavior.c", "ext/libmemcached-0.32/libmemcached/memcached_callback.c", "ext/libmemcached-0.32/libmemcached/memcached_configure.h.in", "ext/libmemcached-0.32/libmemcached/memcached_connect.c", "ext/libmemcached-0.32/libmemcached/memcached_constants.h", "ext/libmemcached-0.32/libmemcached/memcached_delete.c", "ext/libmemcached-0.32/libmemcached/memcached_do.c", "ext/libmemcached-0.32/libmemcached/memcached_dump.c", "ext/libmemcached-0.32/libmemcached/memcached_exist.c", "ext/libmemcached-0.32/libmemcached/memcached_exist.h", "ext/libmemcached-0.32/libmemcached/memcached_fetch.c", "ext/libmemcached-0.32/libmemcached/memcached_flush.c", "ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c", "ext/libmemcached-0.32/libmemcached/memcached_get.c", "ext/libmemcached-0.32/libmemcached/memcached_get.h", "ext/libmemcached-0.32/libmemcached/memcached_hash.c", "ext/libmemcached-0.32/libmemcached/memcached_hosts.c", "ext/libmemcached-0.32/libmemcached/memcached_internal.h", "ext/libmemcached-0.32/libmemcached/memcached_io.c", "ext/libmemcached-0.32/libmemcached/memcached_io.h", "ext/libmemcached-0.32/libmemcached/memcached_key.c", "ext/libmemcached-0.32/libmemcached/memcached_parse.c", "ext/libmemcached-0.32/libmemcached/memcached_pool.h", "ext/libmemcached-0.32/libmemcached/memcached_purge.c", "ext/libmemcached-0.32/libmemcached/memcached_quit.c", "ext/libmemcached-0.32/libmemcached/memcached_response.c", "ext/libmemcached-0.32/libmemcached/memcached_result.c", "ext/libmemcached-0.32/libmemcached/memcached_result.h", "ext/libmemcached-0.32/libmemcached/memcached_sasl.c", "ext/libmemcached-0.32/libmemcached/memcached_sasl.h", "ext/libmemcached-0.32/libmemcached/memcached_server.c", "ext/libmemcached-0.32/libmemcached/memcached_server.h", "ext/libmemcached-0.32/libmemcached/memcached_stats.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.c", "ext/libmemcached-0.32/libmemcached/memcached_storage.h", "ext/libmemcached-0.32/libmemcached/memcached_strerror.c", "ext/libmemcached-0.32/libmemcached/memcached_string.c", "ext/libmemcached-0.32/libmemcached/memcached_string.h", "ext/libmemcached-0.32/libmemcached/memcached_touch.c", "ext/libmemcached-0.32/libmemcached/memcached_touch.h", "ext/libmemcached-0.32/libmemcached/memcached_types.h", "ext/libmemcached-0.32/libmemcached/memcached_util.h", "ext/libmemcached-0.32/libmemcached/memcached_verbosity.c", "ext/libmemcached-0.32/libmemcached/memcached_version.c", "ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h", "ext/libmemcached-0.32/libmemcached/murmur_hash.c", "ext/libmemcached-0.32/libmemcached/visibility.h", "ext/libmemcached-0.32/libmemcachedutil/Makefile.am", "ext/libmemcached-0.32/libmemcachedutil/Makefile.in", "ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver", "ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c", "ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4", "ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4", "ext/libmemcached-0.32/m4/acx_pthread.m4", "ext/libmemcached-0.32/m4/byteorder.m4", "ext/libmemcached-0.32/m4/deprecated.m4", "ext/libmemcached-0.32/m4/enable_utillib.m4", "ext/libmemcached-0.32/m4/extensions.m4", "ext/libmemcached-0.32/m4/hsieh.m4", "ext/libmemcached-0.32/m4/lib-prefix.m4", "ext/libmemcached-0.32/m4/libtool.m4", "ext/libmemcached-0.32/m4/ltoptions.m4", "ext/libmemcached-0.32/m4/ltsugar.m4", "ext/libmemcached-0.32/m4/ltversion.m4", "ext/libmemcached-0.32/m4/lt~obsolete.m4", "ext/libmemcached-0.32/m4/memcached.m4", "ext/libmemcached-0.32/m4/pandora_64bit.m4", "ext/libmemcached-0.32/m4/pandora_canonical.m4", "ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4", "ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4", "ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4", "ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4", "ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4", "ext/libmemcached-0.32/m4/pandora_have_sasl.m4", "ext/libmemcached-0.32/m4/pandora_header_assert.m4", "ext/libmemcached-0.32/m4/pandora_libtool.m4", "ext/libmemcached-0.32/m4/pandora_optimize.m4", "ext/libmemcached-0.32/m4/pandora_shared_ptr.m4", "ext/libmemcached-0.32/m4/pandora_vc_build.m4", "ext/libmemcached-0.32/m4/pandora_warnings.m4", "ext/libmemcached-0.32/m4/pod2man.m4", "ext/libmemcached-0.32/m4/protocol_binary.m4", "ext/libmemcached-0.32/m4/setsockopt.m4", "ext/libmemcached-0.32/m4/visibility.m4", "ext/libmemcached-0.32/support/Makefile.am", "ext/libmemcached-0.32/support/Makefile.in", "ext/libmemcached-0.32/support/libmemcached-fc.spec.in", "ext/libmemcached-0.32/support/libmemcached.pc.in", "ext/libmemcached-0.32/support/libmemcached.spec", "ext/libmemcached-0.32/support/libmemcached.spec.in", "ext/libmemcached-0.32/support/set_benchmark.sh", "ext/libmemcached-0.32/tests/Makefile.am", "ext/libmemcached-0.32/tests/Makefile.in", "ext/libmemcached-0.32/tests/atomsmasher.c", "ext/libmemcached-0.32/tests/function.c", "ext/libmemcached-0.32/tests/ketama_test_cases.h", "ext/libmemcached-0.32/tests/output.cmp", "ext/libmemcached-0.32/tests/output.res", "ext/libmemcached-0.32/tests/output2.res", "ext/libmemcached-0.32/tests/plus.cpp", "ext/libmemcached-0.32/tests/r/memcat.res", "ext/libmemcached-0.32/tests/r/memcp.res", "ext/libmemcached-0.32/tests/r/memrm.res", "ext/libmemcached-0.32/tests/r/memslap.res", "ext/libmemcached-0.32/tests/r/memstat.res", "ext/libmemcached-0.32/tests/server.c", "ext/libmemcached-0.32/tests/server.h", "ext/libmemcached-0.32/tests/start.c", "ext/libmemcached-0.32/tests/t/memcat.test", "ext/libmemcached-0.32/tests/t/memcp.test", "ext/libmemcached-0.32/tests/t/memrm.test", "ext/libmemcached-0.32/tests/t/memslap.test", "ext/libmemcached-0.32/tests/t/memstat.test", "ext/libmemcached-0.32/tests/test.c", "ext/libmemcached-0.32/tests/test.h", "ext/libmemcached-0.32/tests/udp.c", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/marshal_codec.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "memcached.gemspec", "memcached.pem", "test/profile/benchmark.rb", "test/profile/c_profiler.rb", "test/profile/exercise.rb", "test/profile/rb_profiler.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"]
16
16
  s.homepage = "http://evan.github.com/evan/memcached/"
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Memcached", "--main", "README.rdoc", "--exclude=ext/bin", "--exclude=ext/libmemcached-.*/(clients|tests)"]
18
18
  s.require_paths = ["lib", "ext"]
19
19
  s.rubyforge_project = "evan"
20
- s.rubygems_version = "1.8.23"
21
- s.signing_key = "/Users/eweaver/cloudburst/configuration/gem_certificates/evan_weaver-original-private_key.pem"
20
+ s.rubygems_version = "2.0.6"
21
+ s.signing_key = "/Users/eweaver/cloudburst/configuration/gem_certificates/gem-private_key.pem"
22
22
  s.summary = "An interface to the libmemcached C client."
23
23
  s.test_files = ["test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"]
24
24
 
25
25
  if s.respond_to? :specification_version then
26
- s.specification_version = 3
26
+ s.specification_version = 4
27
27
 
28
28
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
29
29
  s.add_development_dependency(%q<rake>, [">= 0"])
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARldmFu
3
+ MRgwFgYKCZImiZPyLGQBGRYIY2xvdWRidXIxEjAQBgoJkiaJk/IsZAEZFgJzdDAe
4
+ Fw0xMzA4MDkxNzIxMjdaFw0xNDA4MDkxNzIxMjdaMD0xDTALBgNVBAMMBGV2YW4x
5
+ GDAWBgoJkiaJk/IsZAEZFghjbG91ZGJ1cjESMBAGCgmSJomT8ixkARkWAnN0MIIB
6
+ IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5C0Io89nyApnr+PvbNFge9Vs
7
+ yRWAlGBUEMahpXp28VrrfXZT0rAW7JBo4PlCE3jl4nE4dzE6gAdItSycjTosrw7A
8
+ Ir5+xoyl4Vb35adv56TIQQXvNz+BzlqnkAY5JN0CSBRTQb6mxS3hFyD/h4qgDosj
9
+ R2RFVzHqSxCS8xq4Ny8uzOwOi+Xyu4w67fI5JvnPvMxqrlR1eaIQHmxnf76RzC46
10
+ QO5QhufjAYGGXd960XzbQsQyTDUYJzrvT7AdOfiyZzKQykKt8dEpDn+QPjFTnGnT
11
+ QmgJBX5WJN0lHF2l1sbv3gh4Kn1tZu+kTUqeXY6ShAoDTyvZRiFqQdwh8w2lTQID
12
+ AQABo3MwcTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU+WqJz3xQ
13
+ XSea1hRvvHWcIMgeeC4wGwYDVR0RBBQwEoEQZXZhbkBjbG91ZGJ1ci5zdDAbBgNV
14
+ HRIEFDASgRBldmFuQGNsb3VkYnVyLnN0MA0GCSqGSIb3DQEBBQUAA4IBAQAth/dF
15
+ vuoj+VzNgvwg09SiK+l3PsWP8D1jPaleuHe7KLnNVTOVZBHQmFGW7f/KrzGLFyaC
16
+ WPB4j8tuC2kAA/vLidRQbUGrYP+bpgNi2Mb4+N109oT8+1G8g3q3C4Uo89B6kddd
17
+ DfhnhmIZ+ejeHPrqAzwbp0e0fnCLThYdFaJ8FWNPq4lf6z8/oCtFe/dPOXTFtg+o
18
+ ZfyWyxMwnyaIe59YRB2vUg0jup3e4GLGGDaFacFarxIA69IfqCtzDA+BVqD5xjob
19
+ KBJ2lOaQtQy7Rlul0reUKqOc+LTMoebY/z+cmbYwfhN4tOFskhn1h09KEvsyPXkm
20
+ /ytodP0AZbjpjMXw
21
+ -----END CERTIFICATE-----
@@ -100,7 +100,7 @@ class MemcachedTest < Test::Unit::TestCase
100
100
  def test_options_are_set
101
101
  Memcached::DEFAULTS.merge(@noblock_options).each do |key, expected|
102
102
  value = @noblock_cache.options[key]
103
- unless key == :rcv_timeout or key == :poll_timeout or key == :prefix_key or key == :ketama_weighted
103
+ unless key == :rcv_timeout or key == :poll_timeout or key == :prefix_key or key == :ketama_weighted or key == :snd_timeout
104
104
  assert(expected == value, "#{key} should be #{expected} but was #{value}")
105
105
  end
106
106
  end
@@ -1,5 +1,6 @@
1
1
  require File.expand_path("#{File.dirname(__FILE__)}/../test_helper")
2
2
  require 'active_support/duration'
3
+ require 'logger'
3
4
 
4
5
  class RailsTest < Test::Unit::TestCase
5
6
 
@@ -7,7 +8,7 @@ class RailsTest < Test::Unit::TestCase
7
8
  @servers = ['127.0.0.1:43042', '127.0.0.1:43043', "#{UNIX_SOCKET_NAME}0"]
8
9
  @duration = ActiveSupport::Duration.new(2592000, [[:months, 1]])
9
10
  @namespace = 'rails_test'
10
- @cache = Memcached::Rails.new(:servers => @servers, :namespace => @namespace)
11
+ @cache = Memcached::Rails.new(:servers => @servers, :namespace => @namespace, :logger => Logger.new(File.open("/dev/null", "w")))
11
12
  @value = OpenStruct.new(:a => 1, :b => 2, :c => GenericClass)
12
13
  @marshalled_value = Marshal.dump(@value)
13
14
  end
@@ -196,6 +197,24 @@ class RailsTest < Test::Unit::TestCase
196
197
  @cache.write key, @value, :expires_in => 123
197
198
  end
198
199
 
200
+ def test_write_with_unless_exist
201
+ @cache.write key, @value, :unless_exist => true
202
+ result = @cache.get key
203
+ assert_equal @value, result
204
+
205
+ rand_value = "rand-value-#{rand}"
206
+ @cache.write key, rand_value, :unless_exist => true
207
+
208
+ result = @cache.get key
209
+ assert_equal @value, result
210
+ end
211
+
212
+ def test_write_with_fixnum_and_raw
213
+ @cache.write key, 1, :raw => true
214
+ result = @cache.read key, :raw => true
215
+ assert_equal "1", result
216
+ end
217
+
199
218
  def test_add_with_duration
200
219
  @cache.add key, @value, @duration
201
220
  result = @cache.get key
@@ -217,6 +236,19 @@ class RailsTest < Test::Unit::TestCase
217
236
  @cache.fetch("y", :foo => :bar){ 1 }
218
237
  end
219
238
 
239
+ def test_fetch_when_no_block_given
240
+ rand_key = "key-#{rand}"
241
+
242
+ # gets nil the first time
243
+ assert_equal nil, @cache.fetch(rand_key)
244
+
245
+ # sets value to @value
246
+ assert_equal @value, @cache.fetch(rand_key) { @value }
247
+
248
+ # gets @value
249
+ assert_equal @value, @cache.fetch(rand_key)
250
+ end
251
+
220
252
  def test_read_multi
221
253
  # empty
222
254
  assert_equal({}, @cache.read_multi)
@@ -250,6 +282,42 @@ class RailsTest < Test::Unit::TestCase
250
282
  assert_equal nil, @cache.read("x")
251
283
  end
252
284
 
285
+ def test_increment
286
+ rand_key = "rand-key-#{rand}"
287
+ assert_equal nil, @cache.increment(rand_key)
288
+
289
+ start = 10
290
+ @cache.write rand_key, start.to_s, { :raw => true }
291
+
292
+ assert_equal start, @cache.read(rand_key, { :raw => true }).to_i
293
+ assert_equal start+1, @cache.increment(rand_key)
294
+
295
+ assert_equal start+1+5, @cache.increment(rand_key, 5)
296
+ end
297
+
298
+ def test_decrement
299
+ rand_key = "rand-key-#{rand}"
300
+ assert_equal nil, @cache.decrement(rand_key)
301
+
302
+ start = 10
303
+ @cache.write rand_key, start.to_s, { :raw => true }
304
+
305
+ assert_equal start, @cache.read(rand_key, { :raw => true }).to_i
306
+ assert_equal start-1, @cache.decrement(rand_key)
307
+
308
+ assert_equal start-1-5, @cache.decrement(rand_key, 5)
309
+ end
310
+
311
+ def test_read_with_nil_options
312
+ @cache.write key, @value
313
+ assert_equal @value, @cache.read(key, nil)
314
+ end
315
+
316
+ def test_write_with_nil_options
317
+ @cache.write key, @value, nil
318
+ assert_equal @value, @cache.read(key)
319
+ end
320
+
253
321
  private
254
322
 
255
323
  def key
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
5
- prerelease:
4
+ version: 1.7.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Evan Weaver
@@ -10,11 +9,11 @@ autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
11
  - !binary |-
13
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhhZ0F3SUJB
14
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE5TVEwd0N3WURWUVFEREFSbGRt
12
+ LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURhRENDQWxDZ0F3SUJB
13
+ Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREE5TVEwd0N3WURWUVFEREFSbGRt
15
14
  RnUKTVJnd0ZnWUtDWkltaVpQeUxHUUJHUllJWTJ4dmRXUmlkWEl4RWpBUUJn
16
- b0praWFKay9Jc1pBRVpGZ0p6ZERBZQpGdzB3TnpBNU1UWXhNRE16TURCYUZ3
17
- MHdPREE1TVRVeE1ETXpNREJhTUQweERUQUxCZ05WQkFNTUJHVjJZVzR4CkdE
15
+ b0praWFKay9Jc1pBRVpGZ0p6ZERBZQpGdzB4TXpBNE1Ea3hOekl4TWpkYUZ3
16
+ MHhOREE0TURreE56SXhNamRhTUQweERUQUxCZ05WQkFNTUJHVjJZVzR4CkdE
18
17
  QVdCZ29Ka2lhSmsvSXNaQUVaRmdoamJHOTFaR0oxY2pFU01CQUdDZ21TSm9t
19
18
  VDhpeGtBUmtXQW5OME1JSUIKSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4
20
19
  QU1JSUJDZ0tDQVFFQTVDMElvODlueUFwbnIrUHZiTkZnZTlWcwp5UldBbEdC
@@ -25,23 +24,24 @@ cert_chain:
25
24
  NzZSekM0NgpRTzVRaHVmakFZR0dYZDk2MFh6YlFzUXlURFVZSnpydlQ3QWRP
26
25
  Zml5WnpLUXlrS3Q4ZEVwRG4rUVBqRlRuR25UClFtZ0pCWDVXSk4wbEhGMmwx
27
26
  c2J2M2doNEtuMXRadStrVFVxZVhZNlNoQW9EVHl2WlJpRnFRZHdoOHcybFRR
28
- SUQKQVFBQm96a3dOekFKQmdOVkhSTUVBakFBTUFzR0ExVWREd1FFQXdJRXNE
29
- QWRCZ05WSFE0RUZnUVUrV3FKejN4UQpYU2VhMWhSdnZIV2NJTWdlZUM0d0RR
30
- WUpLb1pJaHZjTkFRRUZCUUFEZ2dFQkFHTFo3NWpmT0VXOE5zbDI2Q1R0CkpG
31
- cld4UVRjUVQvVWxqZWVmVkUzeFlyN2xjOW9RamJxTzNGT3l1ZWQzcVc3VGFO
32
- RXRaZlNIb1llVVNNWWJwdzEKWEF3b2NJUHVTUkZER000QitoZ1FHVkR4OFBN
33
- R2lKS29tNHFMWGpPNDBVWnNSN1F5Ti91ODY5Vmo0NUxVUm02aApNQmNQZXFD
34
- QVNJK1dOcHJqOSt1WmEya21IaWl0ckZxcWZNQk5sbTVJRmJuOVhlWVN0YTlB
35
- SFZ2czVRUXFWMm01CmhJUGZMcUN5eHNuL1lnT0d2bzZpd3lRVFd5VHN3YW1h
36
- QUMzSFJXWnhJUzFzZm4vU3NxYTdFN29RTWt2NUZBWHIKeDVyS2VQZlhJTmY4
37
- WFRKY3prbDlPQkVZZEU5YU5kSnNKcFhEMGFzTGdHVndCSUNTNUJqb2hwNm1p
38
- ekpjREMxKwp5WjA9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
39
- date: 2013-06-11 00:00:00.000000000 Z
27
+ SUQKQVFBQm8zTXdjVEFKQmdOVkhSTUVBakFBTUFzR0ExVWREd1FFQXdJRXNE
28
+ QWRCZ05WSFE0RUZnUVUrV3FKejN4UQpYU2VhMWhSdnZIV2NJTWdlZUM0d0d3
29
+ WURWUjBSQkJRd0VvRVFaWFpoYmtCamJHOTFaR0oxY2k1emREQWJCZ05WCkhS
30
+ SUVGREFTZ1JCbGRtRnVRR05zYjNWa1luVnlMbk4wTUEwR0NTcUdTSWIzRFFF
31
+ QkJRVUFBNElCQVFBdGgvZEYKdnVvaitWek5ndndnMDlTaUsrbDNQc1dQOEQx
32
+ alBhbGV1SGU3S0xuTlZUT1ZaQkhRbUZHVzdmL0tyekdMRnlhQwpXUEI0ajh0
33
+ dUMya0FBL3ZMaWRSUWJVR3JZUCticGdOaTJNYjQrTjEwOW9UOCsxRzhnM3Ez
34
+ QzRVbzg5QjZrZGRkCkRmaG5obUlaK2VqZUhQcnFBendicDBlMGZuQ0xUaFlk
35
+ RmFKOEZXTlBxNGxmNno4L29DdEZlL2RQT1hURnRnK28KWmZ5V3l4TXdueWFJ
36
+ ZTU5WVJCMnZVZzBqdXAzZTRHTEdHRGFGYWNGYXJ4SUE2OUlmcUN0ekRBK0JW
37
+ cUQ1eGpvYgpLQkoybE9hUXRReTdSbHVsMHJlVUtxT2MrTFRNb2ViWS96K2Nt
38
+ Yll3ZmhONHRPRnNraG4xaDA5S0V2c3lQWGttCi95dG9kUDBBWmJqcGpNWHcK
39
+ LS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
40
+ date: 2013-08-09 00:00:00.000000000 Z
40
41
  dependencies:
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: rake
43
44
  requirement: !ruby/object:Gem::Requirement
44
- none: false
45
45
  requirements:
46
46
  - - ! '>='
47
47
  - !ruby/object:Gem::Version
@@ -49,7 +49,6 @@ dependencies:
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
- none: false
53
52
  requirements:
54
53
  - - ! '>='
55
54
  - !ruby/object:Gem::Version
@@ -57,7 +56,6 @@ dependencies:
57
56
  - !ruby/object:Gem::Dependency
58
57
  name: mocha
59
58
  requirement: !ruby/object:Gem::Requirement
60
- none: false
61
59
  requirements:
62
60
  - - ! '>='
63
61
  - !ruby/object:Gem::Version
@@ -65,7 +63,6 @@ dependencies:
65
63
  type: :development
66
64
  prerelease: false
67
65
  version_requirements: !ruby/object:Gem::Requirement
68
- none: false
69
66
  requirements:
70
67
  - - ! '>='
71
68
  - !ruby/object:Gem::Version
@@ -73,7 +70,6 @@ dependencies:
73
70
  - !ruby/object:Gem::Dependency
74
71
  name: echoe
75
72
  requirement: !ruby/object:Gem::Requirement
76
- none: false
77
73
  requirements:
78
74
  - - ! '>='
79
75
  - !ruby/object:Gem::Version
@@ -81,7 +77,6 @@ dependencies:
81
77
  type: :development
82
78
  prerelease: false
83
79
  version_requirements: !ruby/object:Gem::Requirement
84
- none: false
85
80
  requirements:
86
81
  - - ! '>='
87
82
  - !ruby/object:Gem::Version
@@ -89,7 +84,6 @@ dependencies:
89
84
  - !ruby/object:Gem::Dependency
90
85
  name: activesupport
91
86
  requirement: !ruby/object:Gem::Requirement
92
- none: false
93
87
  requirements:
94
88
  - - ! '>='
95
89
  - !ruby/object:Gem::Version
@@ -97,7 +91,6 @@ dependencies:
97
91
  type: :development
98
92
  prerelease: false
99
93
  version_requirements: !ruby/object:Gem::Requirement
100
- none: false
101
94
  requirements:
102
95
  - - ! '>='
103
96
  - !ruby/object:Gem::Version
@@ -355,6 +348,7 @@ files:
355
348
  - lib/memcached/memcached.rb
356
349
  - lib/memcached/rails.rb
357
350
  - memcached.gemspec
351
+ - memcached.pem
358
352
  - test/profile/benchmark.rb
359
353
  - test/profile/c_profiler.rb
360
354
  - test/profile/exercise.rb
@@ -369,6 +363,7 @@ files:
369
363
  - test/unit/rails_test.rb
370
364
  homepage: http://evan.github.com/evan/memcached/
371
365
  licenses: []
366
+ metadata: {}
372
367
  post_install_message:
373
368
  rdoc_options:
374
369
  - --line-numbers
@@ -383,22 +378,20 @@ require_paths:
383
378
  - lib
384
379
  - ext
385
380
  required_ruby_version: !ruby/object:Gem::Requirement
386
- none: false
387
381
  requirements:
388
382
  - - ! '>='
389
383
  - !ruby/object:Gem::Version
390
384
  version: '0'
391
385
  required_rubygems_version: !ruby/object:Gem::Requirement
392
- none: false
393
386
  requirements:
394
387
  - - ! '>='
395
388
  - !ruby/object:Gem::Version
396
389
  version: '1.2'
397
390
  requirements: []
398
391
  rubyforge_project: evan
399
- rubygems_version: 1.8.23
392
+ rubygems_version: 2.0.6
400
393
  signing_key:
401
- specification_version: 3
394
+ specification_version: 4
402
395
  summary: An interface to the libmemcached C client.
403
396
  test_files:
404
397
  - test/test_helper.rb
metadata.gz.sig CHANGED
Binary file