From c044c079ab14487b4410874be2169ab4aa9b8a23 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 19 Dec 2008 13:05:45 +0000 Subject: Revert "Auto-load template handlers based on unmatched extensions [#1540 state:resolved]" This reverts commit e8c1915416579a3840573ca2c80822d96cb31823. Reasons : - ActionPack tests run very slow - Gem.searcher hanging for long time when extension is nil --- actionpack/lib/action_view/template.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view/template.rb') diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index 8f4ca433c0..93748638c3 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -98,6 +98,10 @@ module ActionView #:nodoc: end private + def valid_extension?(extension) + Template.template_handler_extensions.include?(extension) + end + def find_full_path(path, load_paths) load_paths = Array(load_paths) + [nil] load_paths.each do |load_path| @@ -111,11 +115,11 @@ module ActionView #:nodoc: # [base_path, name, format, extension] def split(file) if m = file.match(/^(.*\/)?([^\.]+)\.?(\w+)?\.?(\w+)?\.?(\w+)?$/) - if Template.valid_extension?(m[5]) # Multipart formats + if valid_extension?(m[5]) # Multipart formats [m[1], m[2], "#{m[3]}.#{m[4]}", m[5]] - elsif Template.valid_extension?(m[4]) # Single format + elsif valid_extension?(m[4]) # Single format [m[1], m[2], m[3], m[4]] - elsif Template.valid_extension?(m[3]) # No format + elsif valid_extension?(m[3]) # No format [m[1], m[2], nil, m[3]] else # No extension [m[1], m[2], m[3], nil] -- cgit v1.2.3