haml-edge 2.3.48 → 2.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/haml/precompiler.rb +2 -2
- data/test/haml/template_test.rb +20 -2
- metadata +1 -1
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.49
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.49
|
data/lib/haml/precompiler.rb
CHANGED
@@ -313,7 +313,7 @@ END
|
|
313
313
|
|
314
314
|
@precompiled <<
|
315
315
|
if @options[:ugly]
|
316
|
-
"
|
316
|
+
"_hamlout.buffer << \"#{text}\";"
|
317
317
|
else
|
318
318
|
"_hamlout.push_text(\"#{text}\", #{tab_change}, #{@dont_tab_up_next_text.inspect});"
|
319
319
|
end
|
@@ -375,7 +375,7 @@ END
|
|
375
375
|
|
376
376
|
push_silent "haml_temp = #{text}"
|
377
377
|
newline_now
|
378
|
-
push_and_tabulate([:loud, "
|
378
|
+
push_and_tabulate([:loud, "_hamlout.buffer << #{no_format ? "#{output_temp}.to_s;" : out}",
|
379
379
|
!(opts[:in_tag] || opts[:nuke_inner_whitespace] || @options[:ugly])])
|
380
380
|
end
|
381
381
|
|
data/test/haml/template_test.rb
CHANGED
@@ -84,8 +84,8 @@ class TemplateTest < Test::Unit::TestCase
|
|
84
84
|
base
|
85
85
|
end
|
86
86
|
|
87
|
-
def render(text)
|
88
|
-
Haml::Engine.new(text).to_html(@base)
|
87
|
+
def render(text, opts = {})
|
88
|
+
Haml::Engine.new(text, opts).to_html(@base)
|
89
89
|
end
|
90
90
|
|
91
91
|
def load_result(name)
|
@@ -184,6 +184,24 @@ class TemplateTest < Test::Unit::TestCase
|
|
184
184
|
Haml::Template.options = {}
|
185
185
|
end
|
186
186
|
|
187
|
+
def test_with_output_buffer_with_ugly
|
188
|
+
return unless Haml::Util.has?(:instance_method, ActionView::Base, :with_output_buffer)
|
189
|
+
assert_equal(<<HTML, render(<<HAML, :ugly => true))
|
190
|
+
<p>
|
191
|
+
foo
|
192
|
+
baz
|
193
|
+
</p>
|
194
|
+
HTML
|
195
|
+
%p
|
196
|
+
foo
|
197
|
+
- with_output_buffer do
|
198
|
+
bar
|
199
|
+
= "foo".gsub(/./) do |s|
|
200
|
+
- s.ord
|
201
|
+
baz
|
202
|
+
HAML
|
203
|
+
end
|
204
|
+
|
187
205
|
def test_exceptions_should_work_correctly
|
188
206
|
begin
|
189
207
|
render("- raise 'oops!'")
|