haml 5.0.0 → 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +18 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +38 -0
  5. data/CHANGELOG.md +43 -19
  6. data/Gemfile +18 -0
  7. data/README.md +1 -0
  8. data/Rakefile +6 -12
  9. data/TODO +24 -0
  10. data/benchmark.rb +66 -0
  11. data/haml.gemspec +39 -0
  12. data/lib/haml/.gitattributes +1 -0
  13. data/lib/haml/attribute_parser.rb +4 -0
  14. data/lib/haml/compiler.rb +2 -1
  15. data/lib/haml/helpers/safe_erubi_template.rb +0 -8
  16. data/lib/haml/options.rb +3 -0
  17. data/lib/haml/railtie.rb +11 -2
  18. data/lib/haml/temple_engine.rb +1 -0
  19. data/lib/haml/version.rb +1 -1
  20. data/test/attribute_parser_test.rb +4 -0
  21. data/test/engine_test.rb +7 -0
  22. data/test/filters_test.rb +2 -7
  23. data/test/template_test.rb +10 -0
  24. data/yard/default/.gitignore +1 -0
  25. data/yard/default/fulldoc/html/css/common.sass +15 -0
  26. data/yard/default/layout/html/footer.erb +12 -0
  27. metadata +13 -65
  28. data/test/erb/_av_partial_1.erb +0 -12
  29. data/test/erb/_av_partial_2.erb +0 -8
  30. data/test/erb/action_view.erb +0 -62
  31. data/test/erb/standard.erb +0 -55
  32. data/test/gemfiles/Gemfile.rails-4.0.x +0 -11
  33. data/test/gemfiles/Gemfile.rails-4.0.x.lock +0 -87
  34. data/test/gemfiles/Gemfile.rails-4.1.x +0 -5
  35. data/test/gemfiles/Gemfile.rails-4.2.x +0 -5
  36. data/test/gemfiles/Gemfile.rails-5.0.x +0 -4
  37. data/test/markaby/standard.mab +0 -52
  38. data/test/mocks/article.rb +0 -6
  39. data/test/results/bemit.xhtml +0 -4
  40. data/test/results/content_for_layout.xhtml +0 -12
  41. data/test/results/eval_suppressed.xhtml +0 -9
  42. data/test/results/helpers.xhtml +0 -72
  43. data/test/results/helpful.xhtml +0 -13
  44. data/test/results/just_stuff.xhtml +0 -71
  45. data/test/results/list.xhtml +0 -12
  46. data/test/results/nuke_inner_whitespace.xhtml +0 -40
  47. data/test/results/nuke_outer_whitespace.xhtml +0 -140
  48. data/test/results/original_engine.xhtml +0 -20
  49. data/test/results/partial_layout.xhtml +0 -6
  50. data/test/results/partial_layout_erb.xhtml +0 -6
  51. data/test/results/partials.xhtml +0 -22
  52. data/test/results/render_layout.xhtml +0 -3
  53. data/test/results/silent_script.xhtml +0 -74
  54. data/test/results/standard.xhtml +0 -159
  55. data/test/results/tag_parsing.xhtml +0 -23
  56. data/test/results/very_basic.xhtml +0 -5
  57. data/test/results/whitespace_handling.xhtml +0 -91
  58. data/test/template_test_helper.rb +0 -38
  59. data/test/templates/_av_partial_1.haml +0 -9
  60. data/test/templates/_av_partial_2.haml +0 -5
  61. data/test/templates/_layout.erb +0 -3
  62. data/test/templates/_layout_for_partial.haml +0 -3
  63. data/test/templates/_partial.haml +0 -8
  64. data/test/templates/_text_area.haml +0 -3
  65. data/test/templates/_text_area_helper.html.haml +0 -4
  66. data/test/templates/action_view.haml +0 -47
  67. data/test/templates/bemit.haml +0 -3
  68. data/test/templates/breakage.haml +0 -8
  69. data/test/templates/content_for_layout.haml +0 -8
  70. data/test/templates/eval_suppressed.haml +0 -11
  71. data/test/templates/helpers.haml +0 -55
  72. data/test/templates/helpful.haml +0 -11
  73. data/test/templates/just_stuff.haml +0 -86
  74. data/test/templates/list.haml +0 -12
  75. data/test/templates/nuke_inner_whitespace.haml +0 -32
  76. data/test/templates/nuke_outer_whitespace.haml +0 -144
  77. data/test/templates/original_engine.haml +0 -17
  78. data/test/templates/partial_layout.haml +0 -3
  79. data/test/templates/partial_layout_erb.erb +0 -4
  80. data/test/templates/partialize.haml +0 -1
  81. data/test/templates/partials.haml +0 -12
  82. data/test/templates/render_layout.haml +0 -2
  83. data/test/templates/silent_script.haml +0 -45
  84. data/test/templates/standard.haml +0 -43
  85. data/test/templates/standard_ugly.haml +0 -1
  86. data/test/templates/tag_parsing.haml +0 -21
  87. data/test/templates/very_basic.haml +0 -4
  88. data/test/templates/whitespace_handling.haml +0 -87
  89. data/test/templates/with_bom.haml +0 -1
  90. data/test/test_helper.rb +0 -99
@@ -1,9 +0,0 @@
1
- %h2 This is a pretty complicated partial
2
- .partial
3
- %p It has several nested partials,
4
- %ul
5
- - 5.times do
6
- %li
7
- %strong Partial:
8
- - @nesting = 5
9
- = render :partial => 'templates/av_partial_2'
@@ -1,5 +0,0 @@
1
- - @nesting -= 1
2
- .partial{:level => @nesting}
3
- %h3 This is a crazy deep-nested partial.
4
- %p== Nesting level #{@nesting}
5
- = render :partial => 'templates/av_partial_2' if @nesting > 0
@@ -1,3 +0,0 @@
1
- Before
2
- <%= yield -%>
3
- After
@@ -1,3 +0,0 @@
1
- .partial-layout
2
- %h2 This is inside a partial layout
3
- = yield
@@ -1,8 +0,0 @@
1
- %p
2
- @foo =
3
- = @foo
4
- - @foo = 'value three'
5
- == Toplevel? #{haml_buffer.toplevel?}
6
- %p
7
- @foo =
8
- = @foo
@@ -1,3 +0,0 @@
1
- .text_area_test_area
2
- ~ "<textarea>" + value + "</textarea>"
3
- = "<textarea>BLAH\n</textarea>"
@@ -1,4 +0,0 @@
1
- - defined?(text_area_helper) and nil # silence a warning
2
- .foo
3
- .bar
4
- = text_area :post, :body
@@ -1,47 +0,0 @@
1
- !!!
2
- %html{html_attrs}
3
- %head
4
- %title Hampton Catlin Is Totally Awesome
5
- %meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
6
- %body
7
- %h1
8
- This is very much like the standard template,
9
- except that it has some ActionView-specific stuff.
10
- It's only used for benchmarking.
11
- .crazy_partials= render :partial => 'templates/av_partial_1'
12
- / You're In my house now!
13
- .header
14
- Yes, ladies and gentileman. He is just that egotistical.
15
- Fantastic! This should be multi-line output
16
- The question is if this would translate! Ahah!
17
- = 1 + 9 + 8 + 2 #numbers should work and this should be ignored
18
- #body= " Quotes should be loved! Just like people!"
19
- - 120.times do |number|
20
- - number
21
- Wow.|
22
- %p
23
- = "Holy cow " + |
24
- "multiline " + |
25
- "tags! " + |
26
- "A pipe (|) even!" |
27
- = [1, 2, 3].collect { |n| "PipesIgnored|" }
28
- = [1, 2, 3].collect { |n| |
29
- n.to_s |
30
- }.join("|") |
31
- %div.silent
32
- - foo = String.new
33
- - foo << "this"
34
- - foo << " shouldn't"
35
- - foo << " evaluate"
36
- = foo + " but now it should!"
37
- -# Woah crap a comment!
38
-
39
- -# That was a line that shouldn't close everything.
40
- %ul.really.cool
41
- - ('a'..'f').each do |a|
42
- %li= a
43
- #combo.of_divs_with_underscore= @should_eval = "with this text"
44
- = [ 104, 101, 108, 108, 111 ].map do |byte|
45
- - byte.chr
46
- .footer
47
- %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"
@@ -1,3 +0,0 @@
1
- .o-media@md.c-user.c-user--premium
2
- %img.o-media__img@md.c-user__photo.c-avatar{src: '', alt: ''}
3
- %p.o-media__body@md.c-user__bio ...
@@ -1,8 +0,0 @@
1
- %p
2
- %h1 Hello!
3
- = "lots of lines"
4
- - raise "Oh no!"
5
- %p
6
- this is after the exception
7
- %strong yes it is!
8
- ho ho ho.
@@ -1,8 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %body
5
- #yieldy
6
- = yield :layout
7
- #nosym
8
- = yield
@@ -1,11 +0,0 @@
1
- = "not me!"
2
- = "nor me!"
3
- - haml_concat "not even me!"
4
- %p= "NO!"
5
- %p~ "UH-UH!"
6
- %h1 Me!
7
- #foo
8
- %p#bar All
9
- %br/
10
- %p.baz This
11
- Should render
@@ -1,55 +0,0 @@
1
- = h("&&&&&&&&&&&") # This is an ActionView Helper... should load
2
- - foo = capture do # This ActionView Helper is designed for ERB, but should work with haml
3
- %div
4
- %p.title Title
5
- %p.text
6
- Woah this is really crazy
7
- I mean wow,
8
- man.
9
- - 3.times do
10
- = foo
11
- %p foo
12
- - tab_up
13
- %p reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally loooooooooooooooooong
14
- - tab_down
15
- .woah
16
- #funky
17
- = capture_haml do
18
- %div
19
- %h1 Big!
20
- %p Small
21
- / Invisible
22
- = capture do
23
- .dilly
24
- %p foo
25
- %h1 bar
26
- = surround '(', ')' do
27
- %strong parentheses!
28
- = precede '*' do
29
- %span.small Not really
30
- click
31
- = succeed '.' do
32
- %a{:href=>"thing"} here
33
- %p baz
34
- - haml_buffer.tabulation = 10
35
- %p boom
36
- - concat "foo\n"
37
- - haml_buffer.tabulation = 0
38
- = list_of({:google => 'http://www.google.com'}) do |name, link|
39
- %a{ :href => link }= name
40
- %p
41
- - haml_concat "foo"
42
- %div
43
- - haml_concat "bar"
44
- - haml_concat "boom"
45
- baz
46
- - haml_concat "boom, again"
47
- - haml_tag :table do
48
- - haml_tag :tr do
49
- - haml_tag :td, {:class => 'cell'} do
50
- - haml_tag :strong, "strong!"
51
- - haml_concat "data"
52
- - haml_tag :td do
53
- - haml_concat "more_data"
54
- - haml_tag :hr
55
- - haml_tag :div, ''
@@ -1,11 +0,0 @@
1
- %div[@article]
2
- %h1= @article.title
3
- %div= @article.body
4
- #id[@article] id
5
- .class[@article] class
6
- #id.class[@article] id class
7
- %div{:class => "article full"}[@article]= "boo"
8
- %div{'class' => "article full"}[@article]= "moo"
9
- %div.articleFull[@article]= "foo"
10
- %span[@not_a_real_variable_and_will_be_nil]
11
- Boo
@@ -1,86 +0,0 @@
1
- !!! XML
2
- !!! XML ISO-8859-1
3
- !!! XML UtF-8 Foo bar
4
- !!!
5
- !!! 1.1
6
- !!! 1.1 Strict
7
- !!! Strict foo bar
8
- !!! FRAMESET
9
- %strong{:apos => "Foo's bar!"} Boo!
10
- == Embedded? false!
11
- == Embedded? #{true}!
12
- - embedded = true
13
- == Embedded? #{embedded}!
14
- == Embedded? #{"twice! #{true}"}!
15
- == Embedded? #{"one"} af"t"er #{"another"}!
16
- %p== Embedded? false!
17
- %p== Embedded? #{true}!
18
- - embedded = true
19
- %p== Embedded? #{embedded}!
20
- %p== Embedded? #{"twice! #{true}"}!
21
- %p== Embedded? #{"one"} af"t"er #{"another"}!
22
- = "stuff followed by whitespace"
23
-
24
- - if true
25
-
26
- %strong block with whitespace
27
- %p
28
- \Escape
29
- \- character
30
- \%p foo
31
- \yee\ha
32
- \ don't lstrip me
33
- / Short comment
34
- /
35
- This is a block comment
36
- cool, huh?
37
- %strong there can even be sub-tags!
38
- = "Or script!"
39
- -# Haml comment
40
- -#
41
- Nested Haml comment
42
- - raise 'dead'
43
- %p{ :class => "" } class attribute should appear!
44
- %p{ :gorbachev => nil } this attribute shouldn't appear
45
- /[if lte IE6] conditional comment!
46
- /[if gte IE7]
47
- %p Block conditional comment
48
- %div
49
- %h1 Cool, eh?
50
- /[if gte IE5.2]
51
- Woah a period.
52
- = "test" |
53
- "test" |
54
- -# Hard tabs shouldn't throw errors.
55
-
56
- - case :foo
57
- - when :bar
58
- %br Blah
59
- - when :foo
60
- %br
61
- - case :foo
62
- - when :bar
63
- %meta{ :foo => 'blah'}
64
- - when :foo
65
- %meta{ :foo => 'bar'}
66
- %img
67
- %hr
68
- %link
69
- %script Inline content
70
- %br
71
- Nested content
72
- %p.foo{:class => true ? 'bar' : 'baz'}[@article] Blah
73
- %p.foo{:class => false ? 'bar' : ''}[@article] Blah
74
- %p.foo{:class => %w[bar baz]}[@article] Blah
75
- %p.qux{:class => 'quux'}[@article] Blump
76
- %p#foo{:id => %w[bar baz]}[@article] Whee
77
- == #{"Woah inner quotes"}
78
- %p.dynamic_quote{:quotes => "single '", :dyn => 1 + 2}
79
- %p.dynamic_self_closing{:dyn => 1 + 2}/
80
- %body
81
- :plain
82
- hello
83
- %div
84
-
85
- %img
86
-
@@ -1,12 +0,0 @@
1
- !Not a Doctype!
2
- %ul
3
- %li a
4
- %li b
5
- %li c
6
- %li d
7
- %li e
8
- %li f
9
- %li g
10
- %li h
11
- %li i
12
-
@@ -1,32 +0,0 @@
1
- %p
2
- %q< Foo
3
- %p
4
- %q{:a => 1 + 1}< Foo
5
- %p
6
- %q<= "Foo\nBar"
7
- %p
8
- %q{:a => 1 + 1}<= "Foo\nBar"
9
- %p
10
- %q<
11
- Foo
12
- Bar
13
- %p
14
- %q{:a => 1 + 1}<
15
- Foo
16
- Bar
17
- %p
18
- %q<
19
- %div
20
- Foo
21
- Bar
22
- %p
23
- %q{:a => 1 + 1}<
24
- %div
25
- Foo
26
- Bar
27
-
28
- -# Regression test
29
- %p
30
- %q<= "foo"
31
- %q{:a => 1 + 1}
32
- bar
@@ -1,144 +0,0 @@
1
- %p
2
- %p
3
- %q>
4
- Foo
5
- %p
6
- %p
7
- %q{:a => 1 + 1}>
8
- Foo
9
- %p
10
- %p
11
- %q> Foo
12
- %p
13
- %p
14
- %q{:a => 1 + 1}> Foo
15
- %p
16
- %p
17
- %q>
18
- = "Foo"
19
- %p
20
- %p
21
- %q{:a => 1 + 1}>
22
- = "Foo"
23
- %p
24
- %p
25
- %q>= "Foo"
26
- %p
27
- %p
28
- %q{:a => 1 + 1}>= "Foo"
29
- %p
30
- %p
31
- %q>
32
- = "Foo\nBar"
33
- %p
34
- %p
35
- %q{:a => 1 + 1}>
36
- = "Foo\nBar"
37
- %p
38
- %p
39
- %q>= "Foo\nBar"
40
- %p
41
- %p
42
- %q{:a => 1 + 1}>= "Foo\nBar"
43
- %p
44
- %p
45
- - tab_up
46
- foo
47
- %q>
48
- Foo
49
- bar
50
- - tab_down
51
- %p
52
- %p
53
- - tab_up
54
- foo
55
- %q{:a => 1 + 1}>
56
- Foo
57
- bar
58
- - tab_down
59
- %p
60
- %p
61
- - tab_up
62
- foo
63
- %q> Foo
64
- bar
65
- - tab_down
66
- %p
67
- %p
68
- - tab_up
69
- foo
70
- %q{:a => 1 + 1}> Foo
71
- bar
72
- - tab_down
73
- %p
74
- %p
75
- - tab_up
76
- foo
77
- %q>
78
- = "Foo"
79
- bar
80
- - tab_down
81
- %p
82
- %p
83
- - tab_up
84
- foo
85
- %q{:a => 1 + 1}>
86
- = "Foo"
87
- bar
88
- - tab_down
89
- %p
90
- %p
91
- - tab_up
92
- foo
93
- %q>= "Foo"
94
- bar
95
- - tab_down
96
- %p
97
- %p
98
- - tab_up
99
- foo
100
- %q{:a => 1 + 1}>= "Foo"
101
- bar
102
- - tab_down
103
- %p
104
- %p
105
- - tab_up
106
- foo
107
- %q>
108
- = "Foo\nBar"
109
- bar
110
- - tab_down
111
- %p
112
- %p
113
- - tab_up
114
- foo
115
- %q{:a => 1 + 1}>
116
- = "Foo\nBar"
117
- bar
118
- - tab_down
119
- %p
120
- %p
121
- - tab_up
122
- foo
123
- %q>= "Foo\nBar"
124
- bar
125
- - tab_down
126
- %p
127
- %p
128
- - tab_up
129
- foo
130
- %q{:a => 1 + 1}>= "Foo\nBar"
131
- bar
132
- - tab_down
133
- %p
134
- %p
135
- %q>
136
- %p
137
- %p
138
- %q>/
139
- %p
140
- %p
141
- %q{:a => 1 + 1}>
142
- %p
143
- %p
144
- %q{:a => 1 + 1}>/