mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Replacing HAML with Haml.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@228 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
0165623325
commit
3f0c2215e1
7 changed files with 12 additions and 12 deletions
4
Rakefile
4
Rakefile
|
@ -14,7 +14,7 @@ end
|
||||||
# ----- Benchmarking -----
|
# ----- Benchmarking -----
|
||||||
|
|
||||||
temp_desc = <<END
|
temp_desc = <<END
|
||||||
Benchmark HAML against ERb.
|
Benchmark haml against ERb.
|
||||||
TIMES=n sets the number of runs. Defaults to 100.
|
TIMES=n sets the number of runs. Defaults to 100.
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ unless ARGV[0] == 'benchmark'
|
||||||
# ----- Profiling -----
|
# ----- Profiling -----
|
||||||
|
|
||||||
temp_desc = <<-END
|
temp_desc = <<-END
|
||||||
Run a profile of HAML.
|
Run a profile of haml.
|
||||||
TIMES=n sets the number of runs. Defaults to 100.
|
TIMES=n sets the number of runs. Defaults to 100.
|
||||||
FILE=n sets the file to profile. Defaults to 'standard'.
|
FILE=n sets the file to profile. Defaults to 'standard'.
|
||||||
END
|
END
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'haml/helpers'
|
||||||
require 'haml/buffer'
|
require 'haml/buffer'
|
||||||
|
|
||||||
module Haml
|
module Haml
|
||||||
# This is the class where all the parsing and processing of the HAML
|
# This is the class where all the parsing and processing of the haml
|
||||||
# template is done. It can be directly used by the user by creating a
|
# template is done. It can be directly used by the user by creating a
|
||||||
# new instance and calling to_html to render the template. For example:
|
# new instance and calling to_html to render the template. For example:
|
||||||
#
|
#
|
||||||
|
@ -202,7 +202,7 @@ module Haml
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Processes a single line of HAML.
|
# Processes a single line of haml.
|
||||||
#
|
#
|
||||||
# This method doesn't return anything; it simply processes the line and
|
# This method doesn't return anything; it simply processes the line and
|
||||||
# adds the appropriate code to <tt>@precompiled</tt>.
|
# adds the appropriate code to <tt>@precompiled</tt>.
|
||||||
|
|
|
@ -21,7 +21,7 @@ module Haml
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Benchmarks HAML against ERb, and Sass on its own.
|
# Benchmarks haml against ERb, and Sass on its own.
|
||||||
#
|
#
|
||||||
# Returns the results of the benchmarking as a string.
|
# Returns the results of the benchmarking as a string.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Stop. HAML time</title>
|
<title>Stop. haml time</title>
|
||||||
<div id='content'>
|
<div id='content'>
|
||||||
<h1>This is a title!</h1>
|
<h1>This is a title!</h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
= h("&&&&&&&&&&&") # This is an ActionView Helper... should load
|
= h("&&&&&&&&&&&") # This is an ActionView Helper... should load
|
||||||
- foo = capture do # This ActionView Helper is designed for ERB, but should work with HAML
|
- foo = capture do # This ActionView Helper is designed for ERB, but should work with haml
|
||||||
%div
|
%div
|
||||||
%p.title Title
|
%p.title Title
|
||||||
%p.text
|
%p.text
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
!!!
|
!!!
|
||||||
%html
|
%html
|
||||||
%head
|
%head
|
||||||
%title Stop. HAML time
|
%title Stop. haml time
|
||||||
#content
|
#content
|
||||||
%h1 This is a title!
|
%h1 This is a title!
|
||||||
%p Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
%p Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
||||||
|
|
|
@ -7,8 +7,8 @@ require 'profiler'
|
||||||
require 'stringio'
|
require 'stringio'
|
||||||
|
|
||||||
module Haml
|
module Haml
|
||||||
# A profiler for HAML, mostly for development use. This simply implements
|
# A profiler for haml, mostly for development use. This simply implements
|
||||||
# the Ruby profiler for profiling HAML code.
|
# the Ruby profiler for profiling haml code.
|
||||||
class Profiler
|
class Profiler
|
||||||
|
|
||||||
# Creates a new profiler that looks for templates in the base
|
# Creates a new profiler that looks for templates in the base
|
||||||
|
@ -22,9 +22,9 @@ module Haml
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Profiles HAML on the given template with the given number of runs.
|
# Profiles haml on the given template with the given number of runs.
|
||||||
# The template name shouldn't have a file extension; this will
|
# The template name shouldn't have a file extension; this will
|
||||||
# automatically look for a HAML template.
|
# automatically look for a haml template.
|
||||||
#
|
#
|
||||||
# Returns the results of the profiling as a string.
|
# Returns the results of the profiling as a string.
|
||||||
def profile(runs = 100, template_name = 'standard')
|
def profile(runs = 100, template_name = 'standard')
|
||||||
|
|
Loading…
Reference in a new issue