Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11290 (new enhancement)

Opened 2 months ago

Last modified 2 months ago

[PATCH] session store MemCacheStore should not need memcache-client gem

Reported by: evan Assigned to: core
Priority: normal Milestone: 2.1
Component: ActionPack Version: edge
Severity: normal Keywords: cache memcached
Cc:

Description

There are other ways to install a CACHE object, so the check around

  require_library_or_gem 'memcache'

isn't necessary.

Personally I would like to remove the gem autorequire because it's not intuitive, but I understand if some people want to keep it.

Burying the default host in line 56 is obscure:

  @cache = options['cache'] || MemCache.new('localhost') 

That's the only place where MemCacheStore really depends on memcache-client.

Ideally options['cache'] would just be a required key.

Attachments

mem_cache_store.patch (6.3 kB) - added by evan on 03/08/08 21:54:26.
Patch for #11290

Change History

03/05/08 19:52:19 changed by evan

  • component changed from ActiveRecord to ActionPack.

03/05/08 22:15:26 changed by bitsweat

  • keywords set to cache memcached.
  • type changed from defect to enhancement.
  • milestone changed from 2.x to 2.1.

Agreed; patch welcome :)

03/08/08 21:44:00 changed by evan

References #8662.

03/08/08 21:54:26 changed by evan

  • attachment mem_cache_store.patch added.

Patch for #11290

03/08/08 21:55:58 changed by evan

Thanks, patch attached. Tests still pass.

However, 'memcache-client' still gets autoloaded (at least in 2.0.2) if it is installed, which seems odd. What's the vendored copy for in trunk?

03/08/08 21:56:29 changed by evan

  • summary changed from session store MemCacheStore should not need memcache-client gem to [PATCH] session store MemCacheStore should not need memcache-client gem.