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