haml 5.0.0 → 5.0.1
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.
- checksums.yaml +4 -4
- data/.gitignore +18 -0
- data/.gitmodules +3 -0
- data/.travis.yml +38 -0
- data/CHANGELOG.md +43 -19
- data/Gemfile +18 -0
- data/README.md +1 -0
- data/Rakefile +6 -12
- data/TODO +24 -0
- data/benchmark.rb +66 -0
- data/haml.gemspec +39 -0
- data/lib/haml/.gitattributes +1 -0
- data/lib/haml/attribute_parser.rb +4 -0
- data/lib/haml/compiler.rb +2 -1
- data/lib/haml/helpers/safe_erubi_template.rb +0 -8
- data/lib/haml/options.rb +3 -0
- data/lib/haml/railtie.rb +11 -2
- data/lib/haml/temple_engine.rb +1 -0
- data/lib/haml/version.rb +1 -1
- data/test/attribute_parser_test.rb +4 -0
- data/test/engine_test.rb +7 -0
- data/test/filters_test.rb +2 -7
- data/test/template_test.rb +10 -0
- data/yard/default/.gitignore +1 -0
- data/yard/default/fulldoc/html/css/common.sass +15 -0
- data/yard/default/layout/html/footer.erb +12 -0
- metadata +13 -65
- data/test/erb/_av_partial_1.erb +0 -12
- data/test/erb/_av_partial_2.erb +0 -8
- data/test/erb/action_view.erb +0 -62
- data/test/erb/standard.erb +0 -55
- data/test/gemfiles/Gemfile.rails-4.0.x +0 -11
- data/test/gemfiles/Gemfile.rails-4.0.x.lock +0 -87
- data/test/gemfiles/Gemfile.rails-4.1.x +0 -5
- data/test/gemfiles/Gemfile.rails-4.2.x +0 -5
- data/test/gemfiles/Gemfile.rails-5.0.x +0 -4
- data/test/markaby/standard.mab +0 -52
- data/test/mocks/article.rb +0 -6
- data/test/results/bemit.xhtml +0 -4
- data/test/results/content_for_layout.xhtml +0 -12
- data/test/results/eval_suppressed.xhtml +0 -9
- data/test/results/helpers.xhtml +0 -72
- data/test/results/helpful.xhtml +0 -13
- data/test/results/just_stuff.xhtml +0 -71
- data/test/results/list.xhtml +0 -12
- data/test/results/nuke_inner_whitespace.xhtml +0 -40
- data/test/results/nuke_outer_whitespace.xhtml +0 -140
- data/test/results/original_engine.xhtml +0 -20
- data/test/results/partial_layout.xhtml +0 -6
- data/test/results/partial_layout_erb.xhtml +0 -6
- data/test/results/partials.xhtml +0 -22
- data/test/results/render_layout.xhtml +0 -3
- data/test/results/silent_script.xhtml +0 -74
- data/test/results/standard.xhtml +0 -159
- data/test/results/tag_parsing.xhtml +0 -23
- data/test/results/very_basic.xhtml +0 -5
- data/test/results/whitespace_handling.xhtml +0 -91
- data/test/template_test_helper.rb +0 -38
- data/test/templates/_av_partial_1.haml +0 -9
- data/test/templates/_av_partial_2.haml +0 -5
- data/test/templates/_layout.erb +0 -3
- data/test/templates/_layout_for_partial.haml +0 -3
- data/test/templates/_partial.haml +0 -8
- data/test/templates/_text_area.haml +0 -3
- data/test/templates/_text_area_helper.html.haml +0 -4
- data/test/templates/action_view.haml +0 -47
- data/test/templates/bemit.haml +0 -3
- data/test/templates/breakage.haml +0 -8
- data/test/templates/content_for_layout.haml +0 -8
- data/test/templates/eval_suppressed.haml +0 -11
- data/test/templates/helpers.haml +0 -55
- data/test/templates/helpful.haml +0 -11
- data/test/templates/just_stuff.haml +0 -86
- data/test/templates/list.haml +0 -12
- data/test/templates/nuke_inner_whitespace.haml +0 -32
- data/test/templates/nuke_outer_whitespace.haml +0 -144
- data/test/templates/original_engine.haml +0 -17
- data/test/templates/partial_layout.haml +0 -3
- data/test/templates/partial_layout_erb.erb +0 -4
- data/test/templates/partialize.haml +0 -1
- data/test/templates/partials.haml +0 -12
- data/test/templates/render_layout.haml +0 -2
- data/test/templates/silent_script.haml +0 -45
- data/test/templates/standard.haml +0 -43
- data/test/templates/standard_ugly.haml +0 -1
- data/test/templates/tag_parsing.haml +0 -21
- data/test/templates/very_basic.haml +0 -4
- data/test/templates/whitespace_handling.haml +0 -87
- data/test/templates/with_bom.haml +0 -1
- data/test/test_helper.rb +0 -99
@@ -1,20 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Stop. haml time</title>
|
5
|
-
<div id='content'>
|
6
|
-
<h1>This is a title!</h1>
|
7
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit</p>
|
8
|
-
<p class='foo'>Cigarettes!</p>
|
9
|
-
<h2>Man alive!</h2>
|
10
|
-
<ul class='things'>
|
11
|
-
<li>Slippers</li>
|
12
|
-
<li>Shoes</li>
|
13
|
-
<li>Bathrobe</li>
|
14
|
-
<li>Coffee</li>
|
15
|
-
</ul>
|
16
|
-
<pre>This is some text that's in a pre block!
|
17
|
-
Let's see what happens when it's rendered! What about now, since we're on a new line?</pre>
|
18
|
-
</div>
|
19
|
-
</head>
|
20
|
-
</html>
|
data/test/results/partials.xhtml
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
<div>
|
2
|
-
<h1>I can count!</h1>
|
3
|
-
1
|
4
|
-
2
|
5
|
-
3
|
6
|
-
4
|
7
|
-
5
|
8
|
-
6
|
9
|
-
7
|
10
|
-
8
|
11
|
-
9
|
12
|
-
10
|
13
|
-
11
|
14
|
-
12
|
15
|
-
13
|
16
|
-
14
|
17
|
-
15
|
18
|
-
16
|
19
|
-
17
|
20
|
-
18
|
21
|
-
19
|
22
|
-
20
|
23
|
-
<h1>I know my ABCs!</h1>
|
24
|
-
<ul>
|
25
|
-
<li>a</li>
|
26
|
-
<li>b</li>
|
27
|
-
<li>c</li>
|
28
|
-
<li>d</li>
|
29
|
-
<li>e</li>
|
30
|
-
<li>f</li>
|
31
|
-
<li>g</li>
|
32
|
-
<li>h</li>
|
33
|
-
<li>i</li>
|
34
|
-
<li>j</li>
|
35
|
-
<li>k</li>
|
36
|
-
<li>l</li>
|
37
|
-
<li>m</li>
|
38
|
-
<li>n</li>
|
39
|
-
<li>o</li>
|
40
|
-
<li>p</li>
|
41
|
-
<li>q</li>
|
42
|
-
<li>r</li>
|
43
|
-
<li>s</li>
|
44
|
-
<li>t</li>
|
45
|
-
<li>u</li>
|
46
|
-
<li>v</li>
|
47
|
-
<li>w</li>
|
48
|
-
<li>x</li>
|
49
|
-
<li>y</li>
|
50
|
-
<li>z</li>
|
51
|
-
</ul>
|
52
|
-
<h1>I can catch errors!</h1>
|
53
|
-
Oh no! "foo" happened!
|
54
|
-
<p>
|
55
|
-
"false" is:
|
56
|
-
false
|
57
|
-
</p>
|
58
|
-
Even!
|
59
|
-
Odd!
|
60
|
-
Even!
|
61
|
-
Odd!
|
62
|
-
Even!
|
63
|
-
</div>
|
64
|
-
<div class='foo'>
|
65
|
-
<strong>foobar</strong>
|
66
|
-
</div>
|
67
|
-
<strong>0</strong>
|
68
|
-
<strong>1</strong>
|
69
|
-
<strong>2</strong>
|
70
|
-
<strong>3</strong>
|
71
|
-
<strong>4</strong>
|
72
|
-
<div class='test'>
|
73
|
-
<p>boom</p>
|
74
|
-
</div>
|
data/test/results/standard.xhtml
DELETED
@@ -1,159 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
-
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
-
<head>
|
4
|
-
<title>Hampton Catlin Is Totally Awesome</title>
|
5
|
-
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
<!-- You're In my house now! -->
|
9
|
-
<div class='header'>
|
10
|
-
Yes, ladies and gentileman. He is just that egotistical.
|
11
|
-
Fantastic! This should be multi-line output
|
12
|
-
The question is if this would translate! Ahah!
|
13
|
-
20
|
14
|
-
</div>
|
15
|
-
<div id='body'> Quotes should be loved! Just like people!</div>
|
16
|
-
0
|
17
|
-
1
|
18
|
-
2
|
19
|
-
3
|
20
|
-
4
|
21
|
-
5
|
22
|
-
6
|
23
|
-
7
|
24
|
-
8
|
25
|
-
9
|
26
|
-
10
|
27
|
-
11
|
28
|
-
12
|
29
|
-
13
|
30
|
-
14
|
31
|
-
15
|
32
|
-
16
|
33
|
-
17
|
34
|
-
18
|
35
|
-
19
|
36
|
-
20
|
37
|
-
21
|
38
|
-
22
|
39
|
-
23
|
40
|
-
24
|
41
|
-
25
|
42
|
-
26
|
43
|
-
27
|
44
|
-
28
|
45
|
-
29
|
46
|
-
30
|
47
|
-
31
|
48
|
-
32
|
49
|
-
33
|
50
|
-
34
|
51
|
-
35
|
52
|
-
36
|
53
|
-
37
|
54
|
-
38
|
55
|
-
39
|
56
|
-
40
|
57
|
-
41
|
58
|
-
42
|
59
|
-
43
|
60
|
-
44
|
61
|
-
45
|
62
|
-
46
|
63
|
-
47
|
64
|
-
48
|
65
|
-
49
|
66
|
-
50
|
67
|
-
51
|
68
|
-
52
|
69
|
-
53
|
70
|
-
54
|
71
|
-
55
|
72
|
-
56
|
73
|
-
57
|
74
|
-
58
|
75
|
-
59
|
76
|
-
60
|
77
|
-
61
|
78
|
-
62
|
79
|
-
63
|
80
|
-
64
|
81
|
-
65
|
82
|
-
66
|
83
|
-
67
|
84
|
-
68
|
85
|
-
69
|
86
|
-
70
|
87
|
-
71
|
88
|
-
72
|
89
|
-
73
|
90
|
-
74
|
91
|
-
75
|
92
|
-
76
|
93
|
-
77
|
94
|
-
78
|
95
|
-
79
|
96
|
-
80
|
97
|
-
81
|
98
|
-
82
|
99
|
-
83
|
100
|
-
84
|
101
|
-
85
|
102
|
-
86
|
103
|
-
87
|
104
|
-
88
|
105
|
-
89
|
106
|
-
90
|
107
|
-
91
|
108
|
-
92
|
109
|
-
93
|
110
|
-
94
|
111
|
-
95
|
112
|
-
96
|
113
|
-
97
|
114
|
-
98
|
115
|
-
99
|
116
|
-
100
|
117
|
-
101
|
118
|
-
102
|
119
|
-
103
|
120
|
-
104
|
121
|
-
105
|
122
|
-
106
|
123
|
-
107
|
124
|
-
108
|
125
|
-
109
|
126
|
-
110
|
127
|
-
111
|
128
|
-
112
|
129
|
-
113
|
130
|
-
114
|
131
|
-
115
|
132
|
-
116
|
133
|
-
117
|
134
|
-
118
|
135
|
-
119
|
136
|
-
Wow.|
|
137
|
-
<p code='3'>
|
138
|
-
Holy cow multiline tags! A pipe (|) even!
|
139
|
-
PipesIgnored|PipesIgnored|PipesIgnored|
|
140
|
-
1|2|3
|
141
|
-
</p>
|
142
|
-
<div class='silent' foo='17'>
|
143
|
-
this shouldn't evaluate but now it should!
|
144
|
-
</div>
|
145
|
-
<ul class='really cool'>
|
146
|
-
<li>a</li>
|
147
|
-
<li>b</li>
|
148
|
-
<li>c</li>
|
149
|
-
<li>d</li>
|
150
|
-
<li>e</li>
|
151
|
-
<li>f</li>
|
152
|
-
</ul>
|
153
|
-
<div class='of_divs_with_underscore' id='combo'>with this text</div>
|
154
|
-
foo<div class='footer'>
|
155
|
-
<strong class='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.
|
156
|
-
So, I'm just making it *really* long. God, I hope this works</strong>
|
157
|
-
</div>
|
158
|
-
</body>
|
159
|
-
</html>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<div class='tags'>
|
2
|
-
<foo>1</foo>
|
3
|
-
<FOO>2</FOO>
|
4
|
-
<fooBAR>3</fooBAR>
|
5
|
-
<fooBar>4</fooBar>
|
6
|
-
<foo_bar>5</foo_bar>
|
7
|
-
<foo-bar>6</foo-bar>
|
8
|
-
<foo:bar>7</foo:bar>
|
9
|
-
<foo class='bar'>8</foo>
|
10
|
-
<fooBAr_baz:boom_bar>9</fooBAr_baz:boom_bar>
|
11
|
-
<foo13>10</foo13>
|
12
|
-
<foo2u>11</foo2u>
|
13
|
-
</div>
|
14
|
-
<div class='classes'>
|
15
|
-
<p class='foo bar' id='boom'></p>
|
16
|
-
<div class='fooBar'>a</div>
|
17
|
-
<div class='foo-bar'>b</div>
|
18
|
-
<div class='foo_bar'>c</div>
|
19
|
-
<div class='FOOBAR'>d</div>
|
20
|
-
<div class='foo16'>e</div>
|
21
|
-
<div class='123'>f</div>
|
22
|
-
<div class='foo2u'>g</div>
|
23
|
-
</div>
|
@@ -1,91 +0,0 @@
|
|
1
|
-
<div id='whitespace_test'>
|
2
|
-
<div class='text_area_test_area'>
|
3
|
-
<textarea>Oneline</textarea>
|
4
|
-
</div>
|
5
|
-
<textarea>BLAH
|
6
|
-
</textarea>
|
7
|
-
|
8
|
-
<div class='text_area_test_area'>
|
9
|
-
<textarea>Two
lines</textarea>
|
10
|
-
</div>
|
11
|
-
<textarea>BLAH
|
12
|
-
</textarea>
|
13
|
-
|
14
|
-
<div class='text_area_test_area'>
|
15
|
-
<textarea>Oneline</textarea>
|
16
|
-
</div>
|
17
|
-
<textarea>BLAH</textarea>
|
18
|
-
|
19
|
-
<div class='text_area_test_area'>
|
20
|
-
<textarea>Two
lines</textarea>
|
21
|
-
</div>
|
22
|
-
<textarea>BLAH</textarea>
|
23
|
-
|
24
|
-
<div id='flattened'><div class='text_area_test_area'>
|
25
|
-
<textarea>Two
lines</textarea>
|
26
|
-
</div>
|
27
|
-
<textarea>BLAH</textarea>
|
28
|
-
</div>
|
29
|
-
</div>
|
30
|
-
<div class='hithere'>
|
31
|
-
Foo bar
|
32
|
-
<pre>foo bar</pre>
|
33
|
-
<pre>foo
bar</pre>
|
34
|
-
<p><pre>foo
bar</pre></p>
|
35
|
-
<p>foo
|
36
|
-
bar</p>
|
37
|
-
</div>
|
38
|
-
<div class='foo'>
|
39
|
-
13
|
40
|
-
<textarea>
|
41
|
-
a
|
42
|
-
</textarea>
|
43
|
-
<textarea>
|
44
|
-
a</textarea></div>
|
45
|
-
<div id='whitespace_test'>
|
46
|
-
<div class='text_area_test_area'>
|
47
|
-
<textarea>Oneline</textarea>
|
48
|
-
</div>
|
49
|
-
<textarea>BLAH
|
50
|
-
</textarea>
|
51
|
-
|
52
|
-
<div class='text_area_test_area'>
|
53
|
-
<textarea>Two
lines</textarea>
|
54
|
-
</div>
|
55
|
-
<textarea>BLAH
|
56
|
-
</textarea>
|
57
|
-
|
58
|
-
<div class='text_area_test_area'>
|
59
|
-
<textarea>Oneline</textarea>
|
60
|
-
</div>
|
61
|
-
<textarea>BLAH</textarea>
|
62
|
-
|
63
|
-
<div class='text_area_test_area'>
|
64
|
-
<textarea>Two
lines</textarea>
|
65
|
-
</div>
|
66
|
-
<textarea>BLAH</textarea>
|
67
|
-
|
68
|
-
<div id='flattened'><div class='text_area_test_area'>
|
69
|
-
<textarea>Two
lines</textarea>
|
70
|
-
</div>
|
71
|
-
<textarea>BLAH</textarea>
|
72
|
-
</div>
|
73
|
-
</div>
|
74
|
-
<div class='hithere'>
|
75
|
-
Foo bar
|
76
|
-
<pre>foo bar</pre>
|
77
|
-
<pre>foo
bar</pre>
|
78
|
-
<p><pre>foo
bar</pre></p>
|
79
|
-
<p>foo
|
80
|
-
bar</p>
|
81
|
-
<pre> ___
 ,o88888
 ,o8888888'
 ,:o:o:oooo. ,8O88Pd8888"
 ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
 ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"
 , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"
 , ..:.::o:ooOoOO8O888O8O,COCOO"
 , . ..:.::o:ooOoOOOO8OOOOCOCO"
 . ..:.::o:ooOoOoOO8O8OCCCC"o
 . ..:.::o:ooooOoCoCCC"o:o
 . ..:.::o:o:,cooooCo"oo:o:
 ` . . ..:.:cocoooo"'o:o:::'
 .` . ..::ccccoc"'o:o:o:::'
 :.:. ,c:cccc"':.:.:.:.:.'
 ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/
 ...:.'.:.::::"' . . . . .'
 .. . ....:."' ` . . . ''
 . . . ...."'
 .. . ."' -hrr-
 .


 It's a planet!
%strong This shouldn't be bold!</pre>
|
82
|
-
<strong>This should!</strong>
|
83
|
-
<textarea> ___ ___ ___ ___ 
 /\__\ /\ \ /\__\ /\__\
 /:/ / /::\ \ /::| | /:/ /
 /:/__/ /:/\:\ \ /:|:| | /:/ / 
 /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ / 
 /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/ 
 \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \ 
 \::/ / \::/ / /:/ / \:\ \ 
 /:/ / /:/ / /:/ / \:\ \ 
 /:/ / /:/ / /:/ / \:\__\
 \/__/ \/__/ \/__/ \/__/
 
 Many
 thanks
 to
 http://www.network-science.de/ascii/
|
84
|
-
<strong>indeed!</strong></textarea>
|
85
|
-
</div>
|
86
|
-
<div class='foo'>
|
87
|
-
13
|
88
|
-
</div>
|
89
|
-
<pre> __ ______ __ ______
.----.| |--.|__ |.----.| |--..--------.| __ |
| __|| ||__ || __|| < | || __ |
|____||__|__||______||____||__|__||__|__|__||______|</pre>
|
90
|
-
<pre>foo
|
91
|
-
bar</pre>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module TemplateTestHelper
|
2
|
-
TEMPLATE_PATH = File.join(__dir__, "templates")
|
3
|
-
end
|
4
|
-
|
5
|
-
module Haml::Filters::Test
|
6
|
-
include Haml::Filters::Base
|
7
|
-
|
8
|
-
def render(text)
|
9
|
-
"TESTING HAHAHAHA!"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module Haml::Helpers
|
14
|
-
def test_partial(name, locals = {})
|
15
|
-
Haml::Engine.new(File.read(File.join(TemplateTestHelper::TEMPLATE_PATH, "_#{name}.haml")), Haml::Template.options).render(self, locals)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class Egocentic
|
20
|
-
def method_missing(*args)
|
21
|
-
self
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class DummyController
|
26
|
-
attr_accessor :logger
|
27
|
-
def initialize
|
28
|
-
@logger = Egocentic.new
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.controller_path
|
32
|
-
''
|
33
|
-
end
|
34
|
-
|
35
|
-
def controller_path
|
36
|
-
''
|
37
|
-
end
|
38
|
-
end
|