factorylabs-cache-money 0.2.7 → 0.2.8

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.
Files changed (2) hide show
  1. data/rails/init.rb +15 -0
  2. metadata +1 -1
data/rails/init.rb CHANGED
@@ -1,5 +1,18 @@
1
1
  require 'cache_money'
2
2
 
3
+ module ::ActiveSupport
4
+ module Cache
5
+ class CacheMoneyMemCacheStore < MemCacheStore
6
+
7
+ def initialize
8
+ @addresses = $memcache.servers
9
+ @data = $memcache
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+
3
16
  memcache_config = YAML.load_file(File.join(Rails.root,'config','memcached.yml'))
4
17
 
5
18
  memcache_options = memcache_config['defaults'].merge(memcache_config[Rails.env])
@@ -11,7 +24,9 @@ else
11
24
  $memcache = Cash::Mock.new
12
25
  end
13
26
 
27
+ ActionController::Base.cache_store = :cache_money_mem_cache_store
14
28
  ActionController::Base.session_options[:cache] = $memcache if memcache_options['sessions']
29
+ silence_warnings { Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(:cache_money_mem_cache_store) }
15
30
 
16
31
  $local = Cash::Local.new($memcache)
17
32
  $lock = Cash::Lock.new($memcache)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factorylabs-cache-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Kallen