class ActionView::PathResolver
def extract_handler_and_format(path, default_formats)
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 handler = Template.handler_class_for_extension(pieces.pop) if pieces.last == "html" && pieces[-2] == "text" correct_path = path.gsub(/\.text\.html/, ".html") ActiveSupport::Deprecation.warn "The file `#{path}` uses the deprecated format `text.html`. Please rename it to #{correct_path}", caller end if pieces.last == "plain" && pieces[-2] == "text" correct_path = path.gsub(/\.text\.plain/, ".text") pieces.pop ActiveSupport::Deprecation.warn "The file `#{path}` uses the deprecated format `text.plain`. Please rename it to #{correct_path}", caller end format = pieces.last && Mime[pieces.last] && pieces.pop.to_sym format ||= handler.default_format if handler.respond_to?(:default_format) format ||= default_formats [handler, format] end