# File vendor/rails/activesupport/lib/active_support/cache.rb, line 20
20: def self.expand_cache_key(key, namespace = nil)
21: expanded_cache_key = namespace ? "#{namespace}/" : ""
22:
23: if ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]
24: expanded_cache_key << "#{ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]}/"
25: end
26:
27: expanded_cache_key << case
28: when key.respond_to?(:cache_key)
29: key.cache_key
30: when key.is_a?(Array)
31: key.collect { |element| expand_cache_key(element) }.to_param
32: when key.respond_to?(:to_param)
33: key.to_param
34: end
35:
36: expanded_cache_key
37: end
# File vendor/rails/activesupport/lib/active_support/cache.rb, line 5
5: def self.lookup_store(*store_option)
6: store, *parameters = *([ store_option ].flatten)
7:
8: case store
9: when Symbol
10: store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize)
11: store_class = ActiveSupport::Cache.const_get(store_class_name)
12: store_class.new(*parameters)
13: when nil
14: ActiveSupport::Cache::MemoryStore.new
15: else
16: store
17: end
18: end