lib/tilt/mapping.rb
# Looks up a list of template classes based on file name. If the file name
# has multiple extensions, it will return all template classes matching the
# extensions from the end.
#
# @example
#   mapping.templates_for('views/index.haml.erb')
#   # => [Tilt::ERBTemplate, Tilt::HamlTemplate]
#
# @return [Array<template class>]
Looks up a list of template classes based on file name. If the file name
has multiple extensions, it will return all template classes matching the
extensions from the end.
Looks up a list of template classes based on file name . If the file name has multiple extensions it will return all template classes matching the extensions from the end .
def templates_for(file)
      templates = []
      while true
        prefix, ext = split(file)
        break unless ext
        templates << lookup(ext)
        file = prefix
      end
      templates
    end
def templates_for ( file ) templates = [ ] while true prefix , ext = split ( file ) break unless ext templates << lookup ( ext ) file = prefix end templates end
Looks up a list of template classes based on file name.
Looks up a list of template classes based on file name .
None
Array<template class>
file
<not_specific>
example
mapping.templates_for('views/index.haml.erb') # => [Tilt::ERBTemplate, Tilt::HamlTemplate]
mapping . templates_for ( ' views / index . haml . erb ' ) # = > [ Tilt :: ERBTemplate Tilt :: HamlTemplate ]