aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template_handlers.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-12-19 13:05:45 +0000
committerPratik Naik <pratiknaik@gmail.com>2008-12-19 13:05:45 +0000
commitc044c079ab14487b4410874be2169ab4aa9b8a23 (patch)
tree44d587668424672ba94e4d1e9404fb4db6c79d32 /actionpack/lib/action_view/template_handlers.rb
parent6ce4b4303543eed6f2c323dcaae291bacfeb4d2c (diff)
downloadrails-c044c079ab14487b4410874be2169ab4aa9b8a23.tar.gz
rails-c044c079ab14487b4410874be2169ab4aa9b8a23.tar.bz2
rails-c044c079ab14487b4410874be2169ab4aa9b8a23.zip
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
Diffstat (limited to 'actionpack/lib/action_view/template_handlers.rb')
-rw-r--r--actionpack/lib/action_view/template_handlers.rb25
1 files changed, 1 insertions, 24 deletions
diff --git a/actionpack/lib/action_view/template_handlers.rb b/actionpack/lib/action_view/template_handlers.rb
index c50a51b0d1..d06ddd5fb5 100644
--- a/actionpack/lib/action_view/template_handlers.rb
+++ b/actionpack/lib/action_view/template_handlers.rb
@@ -28,10 +28,6 @@ module ActionView #:nodoc:
@@template_handlers[extension.to_sym] = klass
end
- def valid_extension?(extension)
- template_handler_extensions.include?(extension) || init_path_for_extension(extension)
- end
-
def template_handler_extensions
@@template_handlers.keys.map(&:to_s).sort
end
@@ -42,26 +38,7 @@ module ActionView #:nodoc:
end
def handler_class_for_extension(extension)
- (extension && @@template_handlers[extension.to_sym] || autoload_handler_class(extension)) ||
- @@default_template_handlers
+ (extension && @@template_handlers[extension.to_sym]) || @@default_template_handlers
end
-
- private
- def autoload_handler_class(extension)
- return if Gem.loaded_specs[extension]
- return unless init_path = init_path_for_extension(extension)
- Gem.activate(extension)
- load(init_path)
- handler_class_for_extension(extension)
- end
-
- # Returns the path to the rails/init.rb file for the given extension,
- # or nil if no gem provides it.
- def init_path_for_extension(extension)
- return unless spec = Gem.searcher.find(extension.to_s)
- returning File.join(spec.full_gem_path, 'rails', 'init.rb') do |path|
- return unless File.file?(path)
- end
- end
end
end