1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

*Really* make :ugly benchmarking work. I hope.

This commit is contained in:
Nathan Weizenbaum 2008-12-28 15:50:01 -08:00
parent baac6a4cb8
commit b4fe64bf9e
6 changed files with 65 additions and 5 deletions

View file

@ -70,8 +70,8 @@ RBench.run(times) do
erb { render @base, 'haml/rhtml/standard' } erb { render @base, 'haml/rhtml/standard' }
Haml::Template.options[:ugly] = true Haml::Template.options[:ugly] = true
render @base, 'haml/templates/standard_link' render @base, 'haml/templates/standard_ugly'
haml_ugly { render @base, 'haml/templates/standard_link' } haml_ugly { render @base, 'haml/templates/standard_ugly' }
end end
report "ActionView with deep partials" do report "ActionView with deep partials" do
@ -87,8 +87,8 @@ RBench.run(times) do
erb { render @base, 'haml/rhtml/action_view' } erb { render @base, 'haml/rhtml/action_view' }
Haml::Template.options[:ugly] = true Haml::Template.options[:ugly] = true
render @base, 'haml/templates/action_view_link' render @base, 'haml/templates/action_view_ugly'
haml_ugly { render @base, 'haml/templates/action_view_link' } haml_ugly { render @base, 'haml/templates/action_view_ugly' }
end end
end end

View file

@ -0,0 +1,9 @@
%h2 This is a pretty complicated partial
.partial
%p It has several nested partials,
%ul
- 5.times do
%li
%strong Partial:
- @nesting = 5
= render :partial => 'haml/templates/av_partial_2_ugly'

View file

@ -0,0 +1,5 @@
- @nesting -= 1
.partial{:level => @nesting}
%h3 This is a crazy deep-nested partial.
%p== Nesting level #{@nesting}
= render :partial => 'haml/templates/av_partial_2_ugly' if @nesting > 0

View file

@ -1 +0,0 @@
action_view.haml

View file

@ -0,0 +1,47 @@
!!!
%html{html_attrs}
%head
%title Hampton Catlin Is Totally Awesome
%meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
%body
%h1
This is very much like the standard template,
except that it has some ActionView-specific stuff.
It's only used for benchmarking.
.crazy_partials= render :partial => 'haml/templates/av_partial_1_ugly'
/ You're In my house now!
.header
Yes, ladies and gentileman. He is just that egotistical.
Fantastic! This should be multi-line output
The question is if this would translate! Ahah!
= 1 + 9 + 8 + 2 #numbers should work and this should be ignored
#body= " Quotes should be loved! Just like people!"
- 120.times do |number|
- number
Wow.|
%p
= "Holy cow " + |
"multiline " + |
"tags! " + |
"A pipe (|) even!" |
= [1, 2, 3].collect { |n| "PipesIgnored|" }
= [1, 2, 3].collect { |n| |
n.to_s |
}.join("|") |
%div.silent
- foo = String.new
- foo << "this"
- foo << " shouldn't"
- foo << " evaluate"
= foo + " but now it should!"
-# Woah crap a comment!
-# That was a line that shouldn't close everything.
%ul.really.cool
- ('a'..'f').each do |a|
%li= a
#combo.of_divs_with_underscore= @should_eval = "with this text"
= [ 104, 101, 108, 108, 111 ].map do |byte|
- byte.chr
.footer
%strong.shout= "This is a really long ruby quote. It should be loved and wrapped because its more than 50 characters. This value may change in the future and this test may look stupid. \nSo, I'm just making it *really* long. God, I hope this works"