Fix performance regression

This commit is contained in:
Jeremy Kemper 2009-01-16 20:36:50 -08:00
parent 78af271069
commit fe013ce934
2 changed files with 6 additions and 2 deletions

@ -204,7 +204,7 @@ def load!
private
def valid_extension?(extension)
Template.template_handler_extensions.include?(extension)
!Template.registered_template_handler(extension).nil?
end
def find_full_path(path, load_paths)

@ -32,13 +32,17 @@ def template_handler_extensions
@@template_handlers.keys.map(&:to_s).sort
end
def registered_template_handler(extension)
extension && @@template_handlers[extension.to_sym]
end
def register_default_template_handler(extension, klass)
register_template_handler(extension, klass)
@@default_template_handlers = klass
end
def handler_class_for_extension(extension)
(extension && @@template_handlers[extension.to_sym]) || @@default_template_handlers
registered_template_handler(extension) || @@default_template_handlers
end
end
end