class ActionView::Resolver

Action View Resolver

def build_path(name, prefix, partial)

Helpers that builds a path. Useful for building virtual paths.
def build_path(name, prefix, partial)
  Path.build(name, prefix, partial)
end

def cached(key, path_info, details, locals) #:nodoc:

:nodoc:
resolver is fresher before returning it.
it always hits the resolver but if the key is present, check if the
always check the cache before hitting the resolver. Otherwise,
Handles templates caching. If a key is given and caching is on
def cached(key, path_info, details, locals) #:nodoc:
  name, prefix, partial = path_info
  locals = locals.map { |x| x.to_s }.sort!
  if key
    @cache.cache(key, name, prefix, partial, locals) do
      decorate(yield, path_info, details, locals)
    end
  else
    decorate(yield, path_info, details, locals)
  end
end

def clear_cache

def clear_cache
  @cache.clear
end

def decorate(templates, path_info, details, locals) #:nodoc:

:nodoc:
Ensures all the resolver information is set in the template.
def decorate(templates, path_info, details, locals) #:nodoc:
  cached = nil
  templates.each do |t|
    t.locals         = locals
    t.formats        = details[:formats]  || [:html] if t.formats.empty?
    t.variants       = details[:variants] || []      if t.variants.empty?
    t.virtual_path ||= (cached ||= build_path(*path_info))
  end
end

def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])

Normalizes the arguments and passes it on to find_templates.
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
  cached(key, [name, prefix, partial], details, locals) do
    find_templates(name, prefix, partial, details, false)
  end
end

def find_all_anywhere(name, prefix, partial=false, details={}, key=nil, locals=[])

def find_all_anywhere(name, prefix, partial=false, details={}, key=nil, locals=[])
  cached(key, [name, prefix, partial], details, locals) do
    find_templates(name, prefix, partial, details, true)
  end
end

def find_templates(name, prefix, partial, details, outside_app_allowed)

normalized.
because Resolver guarantees that the arguments are present and
This is what child classes implement. No defaults are needed
def find_templates(name, prefix, partial, details, outside_app_allowed)
  raise NotImplementedError, "Subclasses must implement a find_templates(name, prefix, partial, details, outside_app_allowed) method"
end

def initialize

def initialize
  @cache = Cache.new
end