Permalink
Browse files

add presence to avoid swallowing capture blocks

  • Loading branch information...
igrigorik committed Nov 9, 2011
1 parent a58c5df commit 89b211013204cc616df0bd428763b5d412af4a68
Showing with 6 additions and 2 deletions.
  1. +4 −0 lib/contextual/contextual.rb
  2. +2 −2 lib/contextual/rails_erubis.rb
@@ -73,6 +73,10 @@ def to_s
def close
@writer.close
end
+
+ def presence
+ @writer.to_s.html_safe
+ end
end
class ContextualEruby < Eruby
@@ -81,7 +81,7 @@ def add_expr_escaped(src, code)
def add_postamble(src)
src << "@output_buffer.close \n"
- src << "p [:CONTEXTUAL,@output_buffer, @output_buffer.to_s, @output_buffer.to_s.html_safe.html_safe?]\n"
+ # src << "p [:CONTEXTUAL,@output_buffer, @output_buffer.to_s, @output_buffer.to_s.html_safe.html_safe?]\n"
src << "@output_buffer.to_s.html_safe"
end
end
@@ -91,4 +91,4 @@ def add_postamble(src)
end
end
-end
+end

0 comments on commit 89b2110

Please sign in to comment.