haml 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

Files changed (48) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/REFERENCE +662 -0
  3. data/Rakefile +167 -0
  4. data/VERSION +1 -0
  5. data/bin/haml +18 -0
  6. data/lib/haml/buffer.rb +224 -0
  7. data/lib/haml/engine.rb +551 -0
  8. data/lib/haml/helpers.rb +220 -0
  9. data/lib/haml/helpers/action_view_mods.rb +53 -0
  10. data/lib/haml/template.rb +138 -0
  11. data/test/benchmark.rb +62 -0
  12. data/test/engine_test.rb +93 -0
  13. data/test/helper_test.rb +105 -0
  14. data/test/mocks/article.rb +6 -0
  15. data/test/profile.rb +45 -0
  16. data/test/results/content_for_layout.xhtml +16 -0
  17. data/test/results/eval_suppressed.xhtml +2 -0
  18. data/test/results/helpers.xhtml +50 -0
  19. data/test/results/helpful.xhtml +5 -0
  20. data/test/results/just_stuff.xhtml +36 -0
  21. data/test/results/list.xhtml +12 -0
  22. data/test/results/original_engine.xhtml +24 -0
  23. data/test/results/partials.xhtml +20 -0
  24. data/test/results/silent_script.xhtml +74 -0
  25. data/test/results/standard.xhtml +42 -0
  26. data/test/results/tag_parsing.xhtml +28 -0
  27. data/test/results/very_basic.xhtml +7 -0
  28. data/test/results/whitespace_handling.xhtml +51 -0
  29. data/test/rhtml/standard.rhtml +51 -0
  30. data/test/runner.rb +15 -0
  31. data/test/template_test.rb +137 -0
  32. data/test/templates/_partial.haml +7 -0
  33. data/test/templates/_text_area.haml +3 -0
  34. data/test/templates/content_for_layout.haml +10 -0
  35. data/test/templates/eval_suppressed.haml +5 -0
  36. data/test/templates/helpers.haml +39 -0
  37. data/test/templates/helpful.haml +6 -0
  38. data/test/templates/just_stuff.haml +29 -0
  39. data/test/templates/list.haml +12 -0
  40. data/test/templates/original_engine.haml +17 -0
  41. data/test/templates/partialize.haml +1 -0
  42. data/test/templates/partials.haml +12 -0
  43. data/test/templates/silent_script.haml +40 -0
  44. data/test/templates/standard.haml +40 -0
  45. data/test/templates/tag_parsing.haml +24 -0
  46. data/test/templates/very_basic.haml +4 -0
  47. data/test/templates/whitespace_handling.haml +66 -0
  48. metadata +108 -0
@@ -0,0 +1,12 @@
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
+
@@ -0,0 +1,17 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Stop. HAML time
5
+ #content
6
+ %h1 This is a title!
7
+ %p Lorem ipsum dolor sit amet, consectetur adipisicing elit
8
+ %p{:class => 'foo'} Cigarettes!
9
+ %h2 Man alive!
10
+ %ul.things
11
+ %li Slippers
12
+ %li Shoes
13
+ %li Bathrobe
14
+ %li Coffee
15
+ %pre
16
+ 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?
@@ -0,0 +1 @@
1
+ = render :file => "#{name}.haml"
@@ -0,0 +1,12 @@
1
+ %p
2
+ @foo =
3
+ = @foo
4
+ - @foo = 'value two'
5
+ %p
6
+ @foo =
7
+ = @foo
8
+ = render :file => "_partial.haml"
9
+ %p
10
+ @foo =
11
+ = @foo
12
+ - @foo = 'value one'
@@ -0,0 +1,40 @@
1
+ %div
2
+ %h1 I can count!
3
+ - (1..20).each do |i|
4
+ = i
5
+ %h1 I know my ABCs!
6
+ %ul
7
+ - ('a'..'z').each do |i|
8
+ %li= i
9
+ %h1 I can catch errors!
10
+ - begin
11
+ - Foo.silly
12
+ - rescue NameError => e
13
+ = "Oh no! \"#{e}\" happened!"
14
+ %p
15
+ "false" is:
16
+ - if false
17
+ = "true"
18
+ - else
19
+ = "false"
20
+ - if true
21
+ - 5.times do |i|
22
+ - if i % 2 == 1
23
+ Odd!
24
+ - else
25
+ Even!
26
+ - else
27
+ = "This can't happen!"
28
+ - 13 |
29
+ .foo
30
+ %strong foobar
31
+ - 5.times |
32
+ do |
33
+ |a| |
34
+ %strong= a
35
+ .test
36
+ - "foo |
37
+ bar |
38
+ baz" |
39
+
40
+ %p boom
@@ -0,0 +1,40 @@
1
+ !!!
2
+ %html{"xml-lang" => "en-US"}
3
+ %head
4
+ %title Hampton Catlin Is Totally Awesome
5
+ %meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}/
6
+ %body
7
+ / You're In my house now!
8
+ .header
9
+ Yes, ladies and gentileman. He is just that egotistical.
10
+ Fantastic! This should be multi-line output
11
+ The question is if this would translate! Ahah!
12
+ = 1 + 9 + 8 + 2 #numbers should work and this should be ignored
13
+ #body= " Quotes should be loved! Just like people!"
14
+ Wow.|
15
+ %p
16
+ = "Holy cow " + |
17
+ "multiline " + |
18
+ "tags! " + |
19
+ "A pipe (|) even!" |
20
+ = [1, 2, 3].collect { |n| "PipesIgnored|" }
21
+ = [1, 2, 3].collect { |n| |
22
+ n.to_s |
23
+ }.join("|") |
24
+ %div.silent
25
+ - foo = String.new
26
+ - foo << "this"
27
+ - foo << " shouldn't"
28
+ - foo << " evaluate"
29
+ = foo + " but now it should!"
30
+ -# Woah crap a comment!
31
+
32
+ -# That was a line that shouldn't close everything.
33
+ %ul.really.cool
34
+ - ('a'..'f').each do |a|
35
+ %li= a
36
+ #combo.of_divs_with_underscore= @should_eval = "with this text"
37
+ = [ 104, 101, 108, 108, 111 ].map do |byte|
38
+ - byte.chr
39
+ .footer
40
+ %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"
@@ -0,0 +1,24 @@
1
+ %div.tags
2
+ %foo 1
3
+ %FOO 2
4
+ %fooBAR 3
5
+ %fooBar 4
6
+ %foo_bar 5
7
+ %foo-bar 6
8
+ %foo:bar 7
9
+ %foo.bar 8
10
+ %fooBAr_baz:boom_bar 9
11
+ %foo13 10
12
+ %foo2u 11
13
+ %div.classes
14
+ %p.foo.bar#baz#boom
15
+ .fooBar a
16
+ .foo-bar b
17
+ .foo_bar c
18
+ .FOOBAR d
19
+ .foo16 e
20
+ .123 f
21
+ .foo2u g
22
+ %div.broken
23
+ %foo<{ :a => :b }
24
+ .foo>{ :c => :d }
@@ -0,0 +1,4 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %body
@@ -0,0 +1,66 @@
1
+ #whitespace_test
2
+ = render :file => "_text_area.haml", :locals => { :value => "Oneline" }
3
+ = render :file => "_text_area.haml", :locals => { :value => "Two\nlines" }
4
+ ~ render :file => "_text_area.haml", :locals => { :value => "Oneline" }
5
+ ~ render :file => "_text_area.haml", :locals => { :value => "Two\nlines" }
6
+ #flattened~ render :file => "_text_area.haml", :locals => { :value => "Two\nlines" }
7
+ .hithere
8
+ ~ "Foo bar"
9
+ ~ "<pre>foo bar</pre>"
10
+ ~ "<pre>foo\nbar</pre>"
11
+ %p~ "<pre>foo\nbar</pre>"
12
+ %p~ "foo\nbar"
13
+ %pre~
14
+ ___
15
+ ,o88888
16
+ ,o8888888'
17
+ ,:o:o:oooo. ,8O88Pd8888"
18
+ ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
19
+ ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"
20
+ , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"
21
+ , ..:.::o:ooOoOO8O888O8O,COCOO"
22
+ , . ..:.::o:ooOoOOOO8OOOOCOCO"
23
+ . ..:.::o:ooOoOoOO8O8OCCCC"o
24
+ . ..:.::o:ooooOoCoCCC"o:o
25
+ . ..:.::o:o:,cooooCo"oo:o:
26
+ ` . . ..:.:cocoooo"'o:o:::'
27
+ .` . ..::ccccoc"'o:o:o:::'
28
+ :.:. ,c:cccc"':.:.:.:.:.'
29
+ ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/
30
+ ...:.'.:.::::"' . . . . .'
31
+ .. . ....:."' ` . . . ''
32
+ . . . ...."'
33
+ .. . ."' -hrr-
34
+ .
35
+
36
+
37
+ It's a planet!
38
+ %strong This shouldn't be bold!
39
+ %strong This should!
40
+ %textarea
41
+ ~
42
+ ___ ___ ___ ___
43
+ /\__\ /\ \ /\__\ /\__\
44
+ /:/ / /::\ \ /::| | /:/ /
45
+ /:/__/ /:/\:\ \ /:|:| | /:/ /
46
+ /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /
47
+ /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/
48
+ \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \
49
+ \::/ / \::/ / /:/ / \:\ \
50
+ /:/ / /:/ / /:/ / \:\ \
51
+ /:/ / /:/ / /:/ / \:\__\
52
+ \/__/ \/__/ \/__/ \/__/
53
+
54
+ Many
55
+ thanks
56
+ to
57
+ http://www.network-science.de/ascii/
58
+ %strong indeed!
59
+ .foo
60
+ ~ 13
61
+ ~ ['a', 'b', 'c'].map do |a|
62
+ - "<textarea>\n#{a}\n</textarea>"
63
+ %pre
64
+ ~
65
+ foo
66
+ bar
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: haml
5
+ version: !ruby/object:Gem::Version
6
+ version: 1.0.0
7
+ date: 2006-12-17 00:00:00 -08:00
8
+ summary: An elegant, structured XHTML/XML templating engine.
9
+ require_paths:
10
+ - lib
11
+ email: haml@googlegroups.com
12
+ homepage: http://haml.hamptoncatlin.com/
13
+ rubyforge_project:
14
+ description: Haml (HTML Abstraction Markup Language) is a layer on top of XHTML or XML that's designed to express the structure of XHTML or XML documents in a non-repetitive, elegant, easy way, using indentation rather than closing tags and allowing Ruby to be embedded with ease. It was originally envisioned as a plugin for Ruby on Rails, but it can function as a stand-alone templating engine.
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Hampton Catlin
30
+ files:
31
+ - lib/haml
32
+ - lib/haml/helpers
33
+ - lib/haml/helpers.rb
34
+ - lib/haml/engine.rb
35
+ - lib/haml/buffer.rb
36
+ - lib/haml/template.rb
37
+ - lib/haml/helpers/action_view_mods.rb
38
+ - bin/haml
39
+ - test/results
40
+ - test/rhtml
41
+ - test/mocks
42
+ - test/templates
43
+ - test/helper_test.rb
44
+ - test/profile.rb
45
+ - test/engine_test.rb
46
+ - test/runner.rb
47
+ - test/benchmark.rb
48
+ - test/template_test.rb
49
+ - test/results/whitespace_handling.xhtml
50
+ - test/results/eval_suppressed.xhtml
51
+ - test/results/very_basic.xhtml
52
+ - test/results/original_engine.xhtml
53
+ - test/results/list.xhtml
54
+ - test/results/just_stuff.xhtml
55
+ - test/results/content_for_layout.xhtml
56
+ - test/results/tag_parsing.xhtml
57
+ - test/results/helpful.xhtml
58
+ - test/results/partials.xhtml
59
+ - test/results/standard.xhtml
60
+ - test/results/silent_script.xhtml
61
+ - test/results/helpers.xhtml
62
+ - test/rhtml/standard.rhtml
63
+ - test/mocks/article.rb
64
+ - test/templates/standard.haml
65
+ - test/templates/helpful.haml
66
+ - test/templates/whitespace_handling.haml
67
+ - test/templates/helpers.haml
68
+ - test/templates/partialize.haml
69
+ - test/templates/eval_suppressed.haml
70
+ - test/templates/list.haml
71
+ - test/templates/_text_area.haml
72
+ - test/templates/content_for_layout.haml
73
+ - test/templates/partials.haml
74
+ - test/templates/silent_script.haml
75
+ - test/templates/very_basic.haml
76
+ - test/templates/original_engine.haml
77
+ - test/templates/_partial.haml
78
+ - test/templates/just_stuff.haml
79
+ - test/templates/tag_parsing.haml
80
+ - Rakefile
81
+ - MIT-LICENSE
82
+ - VERSION
83
+ - REFERENCE
84
+ test_files:
85
+ - test/helper_test.rb
86
+ - test/engine_test.rb
87
+ - test/template_test.rb
88
+ rdoc_options:
89
+ - --title
90
+ - Haml
91
+ - --main
92
+ - REFERENCE
93
+ - --exclude
94
+ - lib/haml/buffer.rb
95
+ - --line-numbers
96
+ - --inline-source
97
+ extra_rdoc_files:
98
+ - MIT-LICENSE
99
+ - VERSION
100
+ - REFERENCE
101
+ executables:
102
+ - haml
103
+ extensions: []
104
+
105
+ requirements: []
106
+
107
+ dependencies: []
108
+