# File lib/haml/helpers/action_view_mods.rb, line 65 65: def capture_erb_with_buffer_with_haml(buffer, *args, &block) 66: if is_haml? 67: capture_haml(*args, &block) 68: else 69: capture_erb_with_buffer_without_haml(buffer, *args, &block) 70: end 71: end
# File lib/haml/helpers/action_view_mods.rb, line 47 47: def capture_with_haml(*args, &block) 48: # Rails' #capture helper will just return the value of the block 49: # if it's not actually in the template context, 50: # as detected by the existance of an _erbout variable. 51: # We've got to do the same thing for compatibility. 52: 53: if is_haml? && block_is_haml?(block) 54: value = nil 55: buffer = capture_haml(*args) { value = yield(*args) } 56: return buffer unless buffer.empty? 57: return value if value.is_a?(String) 58: else 59: capture_without_haml(*args, &block) 60: end 61: end
# File lib/haml/helpers/action_view_mods.rb, line 89 89: def capture_with_haml(*args, &block) 90: if Haml::Helpers.block_is_haml?(block) 91: _hamlout = eval('_hamlout', block.binding) # Necessary since capture_haml checks _hamlout 92: value = nil 93: buffer = capture_haml(*args) { value = yield(*args) } 94: str = 95: if !buffer.empty? 96: buffer 97: elsif value.is_a?(String) 98: value 99: else 100: '' 101: end 102: return ActionView::NonConcattingString.new(str) if defined?(ActionView::NonConcattingString) 103: return str 104: else 105: capture_without_haml(*args, &block) 106: end 107: end
# File lib/haml/helpers/xss_mods.rb, line 108 108: def with_output_buffer_with_haml_xss(*args, &block) 109: res = with_output_buffer_without_haml_xss(*args, &block) 110: case res 111: when Array; res.map {|s| Haml::Util.html_safe(s)} 112: when String; Haml::Util.html_safe(res) 113: else; res 114: end 115: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.