class ActionView::Digestor
def digest(options)
* dependencies - An array of dependent views
* finder - An instance of ActionView::LookupContext
* name - Template name
Supported options:
def digest(options) options.assert_valid_keys(:name, :finder, :dependencies, :partial) cache_key = ([ options[:name], options[:finder].details_key.hash ].compact + Array.wrap(options[:dependencies])).join('.') # this is a correctly done double-checked locking idiom # (ThreadSafe::Cache's lookups have volatile semantics) @@cache[cache_key] || @@digest_monitor.synchronize do @@cache.fetch(cache_key) do # re-check under lock compute_and_store_digest(cache_key, options) end end end