mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Merge pull request #1558 from jkowens/fix-1172
Lookup Tilt class for template engine without loading files
This commit is contained in:
commit
80f8d3be48
1 changed files with 4 additions and 5 deletions
|
@ -169,15 +169,14 @@ module Sinatra
|
|||
settings.template_engines[:all].each do |engine|
|
||||
exts.each { |ext| possible << [engine, "#{name}.#{ext}"] }
|
||||
end
|
||||
|
||||
exts.each do |ext|
|
||||
settings.template_engines[ext].each { |e| possible << [e, name] }
|
||||
end
|
||||
|
||||
possible.each do |engine, template|
|
||||
begin
|
||||
klass = Tilt[engine]
|
||||
rescue LoadError
|
||||
next
|
||||
end
|
||||
klass = Tilt.default_mapping.template_map[engine.to_s] ||
|
||||
Tilt.lazy_map[engine.to_s].fetch(0, [])[0]
|
||||
|
||||
find_template(settings.views, template, klass) do |file|
|
||||
next unless File.exist? file
|
||||
|
|
Loading…
Reference in a new issue