mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Haml] Change rhtml folders and filenames to erb.
This commit is contained in:
parent
9122a94459
commit
e74176a552
6 changed files with 9 additions and 7 deletions
|
@ -40,7 +40,7 @@ RBench.run(times) do
|
|||
template_name = 'standard'
|
||||
directory = File.dirname(__FILE__) + '/haml'
|
||||
haml_template = File.read("#{directory}/templates/#{template_name}.haml")
|
||||
erb_template = File.read("#{directory}/rhtml/#{template_name}.rhtml")
|
||||
erb_template = File.read("#{directory}/erb/#{template_name}.erb")
|
||||
markaby_template = File.read("#{directory}/markaby/#{template_name}.mab")
|
||||
|
||||
report "Cached" do
|
||||
|
@ -64,10 +64,10 @@ RBench.run(times) do
|
|||
Haml::Template.options[:ugly] = false
|
||||
# To cache the template
|
||||
render @base, 'haml/templates/standard'
|
||||
render @base, 'haml/rhtml/standard'
|
||||
render @base, 'haml/erb/standard'
|
||||
|
||||
haml { render @base, 'haml/templates/standard' }
|
||||
erb { render @base, 'haml/rhtml/standard' }
|
||||
erb { render @base, 'haml/erb/standard' }
|
||||
|
||||
Haml::Template.options[:ugly] = true
|
||||
render @base, 'haml/templates/standard_ugly'
|
||||
|
@ -81,10 +81,10 @@ RBench.run(times) do
|
|||
Haml::Template.options[:ugly] = false
|
||||
# To cache the template
|
||||
render @base, 'haml/templates/action_view'
|
||||
render @base, 'haml/rhtml/action_view'
|
||||
render @base, 'haml/erb/action_view'
|
||||
|
||||
haml { render @base, 'haml/templates/action_view' }
|
||||
erb { render @base, 'haml/rhtml/action_view' }
|
||||
erb { render @base, 'haml/erb/action_view' }
|
||||
|
||||
Haml::Template.options[:ugly] = true
|
||||
render @base, 'haml/templates/action_view_ugly'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<li>
|
||||
<strong>Partial:</strong>
|
||||
<% @nesting = 5 %>
|
||||
<%= render :partial => 'haml/rhtml/av_partial_2' %>
|
||||
<%= render :partial => 'haml/erb/av_partial_2' %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
|
@ -3,6 +3,6 @@
|
|||
<h3>This is a crazy deep-nested partial.</h3>
|
||||
<p>Nesting level <%= @nesting %></p>
|
||||
<% if @nesting > 0 %>
|
||||
<%= render :partial => 'haml/rhtml/av_partial_2' %>
|
||||
<%= render :partial => 'haml/erb/av_partial_2' %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -55,6 +55,8 @@ HAML
|
|||
HTML
|
||||
end
|
||||
|
||||
## ERB
|
||||
|
||||
def test_erb
|
||||
assert_equal '- foo = bar', render_erb('<% foo = bar %>')
|
||||
assert_equal '- foo = bar', render_erb('<% foo = bar -%>')
|
||||
|
|
Loading…
Add table
Reference in a new issue