0
+dir = File.dirname(__FILE__)
0
if ActionView.const_defined?(:TemplateFinder)
0
- module ActionView #:nodoc:
0
- class TemplateFinder #:nodoc:
0
- def initialize_with_desert_plugins(*args)
0
- initialize_without_desert_plugins *args
0
- Desert::Manager.plugins.reverse.each do |plugin|
0
- append_view_path plugin.templates_path
0
- alias_method_chain :initialize, :desert_plugins
0
+ require "#{dir}/2.1.0/action_view"
0
- module ActionView #:nodoc:
0
- if private_instance_methods.include?('find_template_extension_from_handler')
0
- if instance_methods.include?('template_handler_preferences')
0
- def find_template_extension_from_handler(template_path, formatted = nil)
0
- checked_template_path = formatted ? "#{template_path}.#{template_format}" : template_path
0
- view_paths.each do |view_path|
0
- template_handler_preferences.each do |template_type|
0
- @@template_handlers.keys
0
- extensions.each do |extension|
0
- file_path = File.join(view_path, "#{checked_template_path}.#{extension}")
0
- if File.exist?(file_path)
0
- return formatted ? "#{template_format}.#{extension}" : extension.to_s
0
- def find_template_extension_from_handler(template_path, formatted = nil)
0
- checked_template_path = formatted ? "#{template_path}.#{template_format}" : template_path
0
- view_paths.each do |view_path|
0
- self.class.template_handler_extensions.each do |extension|
0
- file_path = File.join(view_path, "#{checked_template_path}.#{extension}")
0
- if File.exist?(file_path)
0
- return formatted ? "#{template_format}.#{extension}" : extension.to_s
0
- if instance_methods.include?('view_paths')
0
- def initialize_with_desert_plugins(*args)
0
- initialize_without_desert_plugins *args
0
- Desert::Manager.plugins.reverse.each do |plugin|
0
- view_paths << plugin.templates_path
0
- alias_method_chain :initialize, :desert_plugins
0
- attr_reader :view_paths
0
- def initialize_with_desert(base_path = nil, assigns_for_first_render = {}, controller = nil)
0
- initialize_without_desert(base_path, assigns_for_first_render, controller)
0
- @view_paths = [base_path]
0
- Desert::Manager.plugins_and_app.reverse.each do |plugin|
0
- @view_paths << plugin.templates_path
0
- alias_method_chain :initialize, :desert
0
- def full_path_template_exists?(path, extension)
0
- file_path = "#{path}.#{extension}"
0
- @@method_names.has_key?(file_path) || FileTest.exists?(file_path)
0
- def find_template_extension_for(template_path)
0
- view_paths.each do |view_path|
0
- full_path = "#{view_path}/#{template_path}"
0
- if match = @@template_handlers.find { |k,| full_path_template_exists?(template_path, k) }
0
- return match.first.to_sym
0
- elsif full_path_template_exists?(full_path, :rhtml)
0
- elsif full_path_template_exists?(full_path, :rxml)
0
- elsif full_path_template_exists?(full_path, :rjs)
0
- raise ActionViewError, "No rhtml, rxml, rjs or delegate template found for #{template_path} in #{@base_path}"
0
- def full_template_path_with_plugin_routing(template_path, extension)
0
- full_template_path = full_template_path_without_plugin_routing(template_path, extension)
0
- unless File.exist?(full_template_path)
0
- # Look through the plugins for the template
0
- Desert::Manager.plugins.reverse.each do |plugin|
0
- if plugin_template_path = plugin.find_template("#{template_path}.#{extension}")
0
- full_template_path = plugin_template_path
0
- alias_method_chain :full_template_path, :plugin_routing
0
+ if ActionView::Base.private_instance_methods.include?('find_template_extension_from_handler')
0
+ if ActionView::Base.instance_methods.include?('template_handler_preferences')
0
+ require "#{dir}/1.99.0/action_view"
0
+ require "#{dir}/2.0.2/action_view"
0
+ elsif ActionView.const_defined?(:PathSet)
0
+ require "#{dir}/edge/action_view"
0
+ require "#{dir}/1.2.0/action_view"
0
\ No newline at end of file
Comments
No one has commented yet.