0
if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ module TemplateChecker
0
+ # Handle the case where a module is uses outside of an ActionView context
0
+ # calls to is_haml if it is defined, otherwise returns false.
0
+ include Haml::Helpers::TemplateChecker
0
@@ -18,8 +36,11 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ include Haml::Helpers::TemplateChecker
0
def capture_with_haml(*args, &block)
0
capture_haml(*args, &block)
0
capture_without_haml(*args, &block)
0
@@ -29,7 +50,7 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
alias_method :capture, :capture_with_haml
0
def capture_erb_with_buffer_with_haml(*args, &block)
0
capture_haml_with_buffer(*args, &block)
0
capture_erb_with_buffer_without_haml(*args, &block)
0
@@ -40,8 +61,11 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ include Haml::Helpers::TemplateChecker
0
def concat_with_haml(string, binding = nil)
0
haml_buffer.buffer.concat(string)
0
concat_without_haml(string, binding)
0
@@ -52,10 +76,13 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ include Haml::Helpers::TemplateChecker
0
def content_tag_with_haml(name, *args, &block)
0
content = content_tag_without_haml(name, *args, &block)
0
- if is_haml? && haml_buffer.options[:preserve].include?(name.to_s)
0
+ if check_is_haml? && haml_buffer.options[:preserve].include?(name.to_s)
0
content = Haml::Helpers.preserve content
0
@@ -68,6 +95,8 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ include Haml::Helpers::TemplateChecker
0
@template_object.send :haml_buffer
0
@@ -81,8 +110,11 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ include Haml::Helpers::TemplateChecker
0
def form_tag_with_haml(url_for_options = {}, options = {}, *parameters_for_url, &proc)
0
proc = haml_bind_proc do |*args|
0
@@ -93,7 +125,7 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
res = form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc) + "\n"
0
- concat "\n" if block_given? && is_haml?
0
+ concat "\n" if block_given? && check_is_haml?
0
form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc)
0
@@ -104,8 +136,11 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
+ include Haml::Helpers::TemplateChecker
0
def form_for_with_haml(object_name, *args, &proc)
0
- if block_given? && is_haml?
0
+ if block_given? && check_is_haml?
0
proc = haml_bind_proc do |*args|
0
@@ -114,7 +149,7 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
0
form_for_without_haml(object_name, *args, &proc)
0
- concat "\n" if block_given? && is_haml?
0
+ concat "\n" if block_given? && check_is_haml?
0
alias_method :form_for_without_haml, :form_for
0
alias_method :form_for, :form_for_with_haml
Comments
No one has commented yet.