class ActionView::PathResolver

:nodoc:
An abstract class that implements a Resolver with path semantics.

def build_query(path, details)

Helper for building query glob string based on resolver's pattern.
def build_query(path, details)
  query = @pattern.dup
  prefix = path.prefix.empty? ? "" : "#{escape_entry(path.prefix)}\\1"
  query.gsub!(/\:prefix(\/)?/, prefix)
  partial = escape_entry(path.partial? ? "_#{path.name}" : path.name)
  query.gsub!(/\:action/, partial)
  details.each do |ext, variants|
    query.gsub!(/\:#{ext}/, "{#{variants.compact.uniq.join(',')}}")
  end
  File.expand_path(query, @path)
end

def escape_entry(entry)

def escape_entry(entry)
  entry.gsub(/[*?{}\[\]]/, '\\\\\\&')
end

def extract_handler_and_format(path, default_formats)

to the resolver.
from the path, or the handler, we should return the array of formats given
Extract handler and formats from path. If a format cannot be a found neither
def extract_handler_and_format(path, default_formats)
  pieces = File.basename(path).split(".")
  pieces.shift
  extension = pieces.pop
  unless extension
    message = "The file #{path} did not specify a template handler. The default is currently ERB, " \
              "but will change to RAW in the future."
    ActiveSupport::Deprecation.warn message
  end
  handler = Template.handler_for_extension(extension)
  format  = pieces.last && Template::Types[pieces.last]
  [handler, format]
end

def find_templates(name, prefix, partial, details)

def find_templates(name, prefix, partial, details)
  path = Path.build(name, prefix, partial)
  query(path, details, details[:formats])
end

def initialize(pattern=nil)

def initialize(pattern=nil)
  @pattern = pattern || DEFAULT_PATTERN
  super()
end

def mtime(p)

Returns the file mtime from the filesystem.
def mtime(p)
  File.mtime(p)
end

def query(path, details, formats)

def query(path, details, formats)
  query = build_query(path, details)
  # deals with case-insensitive file systems.
  sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
  template_paths = Dir[query].reject { |filename|
    File.directory?(filename) ||
      !sanitizer[File.dirname(filename)].include?(filename)
  }
  template_paths.map { |template|
    handler, format = extract_handler_and_format(template, formats)
    contents = File.binread template
    Template.new(contents, File.expand_path(template), handler,
      :virtual_path => path.virtual,
      :format       => format,
      :updated_at   => mtime(template))
  }
end