haml 1.5.2 → 1.7.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 (66) hide show
  1. data/MIT-LICENSE +1 -1
  2. data/Rakefile +1 -0
  3. data/VERSION +1 -1
  4. data/bin/css2sass +7 -0
  5. data/bin/html2haml +0 -82
  6. data/lib/haml.rb +43 -6
  7. data/lib/haml/buffer.rb +81 -72
  8. data/lib/haml/engine.rb +240 -110
  9. data/lib/haml/exec.rb +120 -5
  10. data/lib/haml/helpers.rb +88 -3
  11. data/lib/haml/helpers/action_view_extensions.rb +45 -0
  12. data/lib/haml/helpers/action_view_mods.rb +30 -17
  13. data/lib/haml/html.rb +173 -0
  14. data/lib/haml/template.rb +1 -26
  15. data/lib/haml/util.rb +18 -0
  16. data/lib/sass.rb +181 -3
  17. data/lib/sass/constant.rb +38 -9
  18. data/lib/sass/constant/color.rb +25 -1
  19. data/lib/sass/constant/literal.rb +10 -8
  20. data/lib/sass/css.rb +197 -0
  21. data/lib/sass/engine.rb +239 -68
  22. data/lib/sass/error.rb +2 -2
  23. data/lib/sass/plugin.rb +11 -3
  24. data/lib/sass/tree/attr_node.rb +25 -17
  25. data/lib/sass/tree/comment_node.rb +14 -0
  26. data/lib/sass/tree/node.rb +18 -1
  27. data/lib/sass/tree/rule_node.rb +17 -5
  28. data/lib/sass/tree/value_node.rb +4 -0
  29. data/test/haml/engine_test.rb +42 -25
  30. data/test/haml/helper_test.rb +28 -3
  31. data/test/haml/results/eval_suppressed.xhtml +6 -0
  32. data/test/haml/results/helpers.xhtml +26 -2
  33. data/test/haml/results/helpful.xhtml +2 -0
  34. data/test/haml/results/just_stuff.xhtml +17 -2
  35. data/test/haml/results/standard.xhtml +1 -1
  36. data/test/haml/results/whitespace_handling.xhtml +1 -11
  37. data/test/haml/rhtml/standard.rhtml +1 -1
  38. data/test/haml/template_test.rb +7 -2
  39. data/test/haml/templates/eval_suppressed.haml +7 -2
  40. data/test/haml/templates/helpers.haml +16 -1
  41. data/test/haml/templates/helpful.haml +2 -0
  42. data/test/haml/templates/just_stuff.haml +23 -4
  43. data/test/haml/templates/standard.haml +3 -3
  44. data/test/haml/templates/whitespace_handling.haml +0 -50
  45. data/test/sass/engine_test.rb +35 -10
  46. data/test/sass/plugin_test.rb +10 -6
  47. data/test/sass/results/alt.css +4 -0
  48. data/test/sass/results/complex.css +4 -3
  49. data/test/sass/results/constants.css +3 -3
  50. data/test/sass/results/import.css +27 -0
  51. data/test/sass/results/nested.css +7 -0
  52. data/test/sass/results/parent_ref.css +13 -0
  53. data/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  54. data/test/sass/results/subdir/subdir.css +1 -0
  55. data/test/sass/templates/alt.sass +16 -0
  56. data/test/sass/templates/bork2.sass +2 -0
  57. data/test/sass/templates/complex.sass +19 -1
  58. data/test/sass/templates/constants.sass +8 -0
  59. data/test/sass/templates/import.sass +8 -0
  60. data/test/sass/templates/importee.sass +10 -0
  61. data/test/sass/templates/nested.sass +8 -0
  62. data/test/sass/templates/parent_ref.sass +25 -0
  63. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  64. data/test/sass/templates/subdir/subdir.sass +6 -0
  65. metadata +95 -75
  66. data/test/haml/results/semantic.cache +0 -15
@@ -12,3 +12,10 @@
12
12
  font-weight: bold;
13
13
 
14
14
  float: left; }
15
+
16
+ #right .header {
17
+ border-style: solid; }
18
+ #right .body {
19
+ border-style: dotted; }
20
+ #right .footer {
21
+ border-style: dashed; }
@@ -0,0 +1,13 @@
1
+ a { color: #000; }
2
+ a:hover { color: #f00; }
3
+
4
+ p, div { width: 100em; }
5
+ p foo, div foo { width: 10em; }
6
+ p:hover, p bar, div:hover, div bar { height: 20em; }
7
+
8
+ #cool { border-style: solid; border-width: 2em; }
9
+ .ie7 #cool, .ie6 #cool { content: string(Totally not cool.); }
10
+ .firefox #cool { content: string(Quite cool.); }
11
+
12
+ .wow, .snazzy { font-family: fantasy; }
13
+ .wow:hover, .wow:visited, .snazzy:hover, .snazzy:visited { font-weight: bold; }
@@ -0,0 +1 @@
1
+ #pi { width: 314px; }
@@ -0,0 +1 @@
1
+ #subdir { font-size: 20px; font-weight: bold; }
@@ -0,0 +1,16 @@
1
+ h1
2
+ :float left
3
+ :width 274px
4
+ height: 75px
5
+ margin: 0
6
+ background:
7
+ repeat: no-repeat
8
+ :image none
9
+ a:hover, a:visited
10
+ color: green
11
+ b:hover
12
+ color: red
13
+ :background-color green
14
+ const
15
+ nosp= 1 + 2
16
+ sp = 1 + 2
@@ -0,0 +1,2 @@
1
+ bork
2
+ :bork: bork;
@@ -78,9 +78,13 @@ body
78
78
  :margin 0 5px
79
79
  :padding 5px 5px 0 5px
80
80
  :display inline
81
+ // This comment is in the middle of this rule
81
82
  :font-size 1.1em
83
+ // This comment is properly indented
82
84
  :color #fff
83
85
  :background #00a4e4
86
+ / This rule isn't a comment!
87
+ :red green
84
88
  a:link, a:visited
85
89
  :color #fff
86
90
  :text-decoration none
@@ -105,6 +109,9 @@ body
105
109
  a:hover
106
110
  :text-decoration underline
107
111
 
112
+ // A hard tab:
113
+
114
+
108
115
  #content
109
116
  p, div
110
117
  :width 40em
@@ -123,11 +130,20 @@ body
123
130
  :float left
124
131
  :margin 0 1em auto 1em
125
132
  :border 1px solid #6e000d
133
+ :style solid
126
134
  h2
127
135
  :margin 0 0 10px 0
128
136
  :padding 0.5em
137
+ /* The background image is a gif!
129
138
  :background #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat
139
+ /* Okay check this out
140
+ Multiline comments
141
+ Wow dude
142
+ I mean seriously, WOW
130
143
  :text-indent -9999px
144
+ // And also...
145
+ Multiline comments that don't output!
146
+ Snazzy, no?
131
147
  :border
132
148
  :top
133
149
  :width 5px
@@ -231,7 +247,9 @@ body
231
247
  ul
232
248
  :text-align right
233
249
  li
234
- :display inline; border: none; padding: 0; }
250
+ :display inline
251
+ :border none
252
+ :padding 0
235
253
  .column.right
236
254
  :width 290px
237
255
  :padding-left 10px
@@ -10,6 +10,7 @@
10
10
  !qstr= "Quo\"ted\"!"
11
11
  !hstr= "Hyph-en!"
12
12
  !concat = (5 + 4) hi there
13
+ !percent= 11%
13
14
 
14
15
  #main
15
16
  :content = !str
@@ -18,6 +19,8 @@
18
19
  :width = !width
19
20
  :background-color #000
20
21
  :color= !main_text
22
+ :short-color= #123
23
+ :named-color= olive
21
24
  :con= foo bar (!concat boom)
22
25
  :con2= noquo "quo"
23
26
  #sidebar
@@ -40,6 +43,7 @@
40
43
  :num-neg= 10 + -.13
41
44
  :str= 100 + px
42
45
  :col= 13 + #aaa
46
+ :perc = !percent + 20%
43
47
  :str
44
48
  :str= hi + \ there
45
49
  :str2= hi + " there"
@@ -55,6 +59,10 @@
55
59
  :col
56
60
  :num= #fffffa - 5.2
57
61
  :col= #abcdef - #fedcba
62
+ :unary
63
+ :num= -1
64
+ :const= -!neg
65
+ :paren= -(5 + 6)
58
66
 
59
67
  #times
60
68
  :num
@@ -0,0 +1,8 @@
1
+ !preconst = hello
2
+
3
+ @import importee, basic, basic.css, ../results/complex.css
4
+
5
+ nonimported
6
+ :myconst = !preconst
7
+ :otherconst = !postconst
8
+
@@ -0,0 +1,10 @@
1
+ !postconst = goodbye
2
+
3
+ imported
4
+ :otherconst = !preconst
5
+ :myconst = !postconst
6
+
7
+ @import basic
8
+
9
+ midrule
10
+ :inthe middle
@@ -13,3 +13,11 @@
13
13
  :size 2em
14
14
  :weight bold
15
15
  :float left
16
+
17
+ #right
18
+ .header
19
+ :border-style solid
20
+ .body
21
+ :border-style dotted
22
+ .footer
23
+ :border-style dashed
@@ -0,0 +1,25 @@
1
+ a
2
+ :color #000
3
+ &:hover
4
+ :color #f00
5
+
6
+ p, div
7
+ :width 100em
8
+ & foo
9
+ :width 10em
10
+ &:hover, bar
11
+ :height 20em
12
+
13
+ #cool
14
+ :border
15
+ :style solid
16
+ :width 2em
17
+ .ie7 &, .ie6 &
18
+ :content string(Totally not cool.)
19
+ .firefox &
20
+ :content string(Quite cool.)
21
+
22
+ .wow, .snazzy
23
+ :font-family fantasy
24
+ &:hover, &:visited
25
+ :font-weight bold
@@ -0,0 +1,6 @@
1
+ #subdir
2
+ :font
3
+ :size 20px
4
+ :weight bold
5
+
6
+
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: haml
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.5.2
7
- date: 2007-04-09 00:00:00 -07:00
6
+ version: 1.7.0
7
+ date: 2007-07-07 00:00:00 -07:00
8
8
  summary: An elegant, structured XHTML/XML templating engine. Comes with Sass, a similar CSS templating engine.
9
9
  require_paths:
10
10
  - lib
@@ -29,113 +29,133 @@ post_install_message:
29
29
  authors:
30
30
  - Hampton Catlin
31
31
  files:
32
- - lib/haml
32
+ - lib/sass.rb
33
33
  - lib/sass
34
+ - lib/haml
34
35
  - lib/haml.rb
35
- - lib/sass.rb
36
- - lib/haml/helpers
37
- - lib/haml/helpers.rb
38
- - lib/haml/engine.rb
39
- - lib/haml/buffer.rb
40
- - lib/haml/template.rb
41
- - lib/haml/filters.rb
42
- - lib/haml/exec.rb
43
- - lib/haml/error.rb
44
- - lib/haml/helpers/action_view_mods.rb
36
+ - lib/sass/error.rb
45
37
  - lib/sass/tree
38
+ - lib/sass/constant.rb
46
39
  - lib/sass/constant
47
40
  - lib/sass/plugin.rb
41
+ - lib/sass/css.rb
48
42
  - lib/sass/engine.rb
49
- - lib/sass/constant.rb
50
- - lib/sass/error.rb
51
43
  - lib/sass/tree/value_node.rb
52
44
  - lib/sass/tree/attr_node.rb
53
- - lib/sass/tree/rule_node.rb
54
45
  - lib/sass/tree/node.rb
55
- - lib/sass/constant/operation.rb
46
+ - lib/sass/tree/comment_node.rb
47
+ - lib/sass/tree/rule_node.rb
56
48
  - lib/sass/constant/color.rb
57
49
  - lib/sass/constant/string.rb
58
50
  - lib/sass/constant/number.rb
51
+ - lib/sass/constant/operation.rb
59
52
  - lib/sass/constant/literal.rb
60
- - bin/haml
53
+ - lib/haml/util.rb
54
+ - lib/haml/exec.rb
55
+ - lib/haml/html.rb
56
+ - lib/haml/error.rb
57
+ - lib/haml/buffer.rb
58
+ - lib/haml/template.rb
59
+ - lib/haml/helpers.rb
60
+ - lib/haml/filters.rb
61
+ - lib/haml/engine.rb
62
+ - lib/haml/helpers
63
+ - lib/haml/helpers/action_view_extensions.rb
64
+ - lib/haml/helpers/action_view_mods.rb
65
+ - bin/css2sass
61
66
  - bin/sass
67
+ - bin/haml
62
68
  - bin/html2haml
63
- - test/haml
64
69
  - test/sass
70
+ - test/haml
65
71
  - test/profile.rb
66
72
  - test/benchmark.rb
67
- - test/haml/results
68
- - test/haml/rhtml
73
+ - test/sass/templates
74
+ - test/sass/plugin_test.rb
75
+ - test/sass/results
76
+ - test/sass/engine_test.rb
77
+ - test/sass/templates/bork2.sass
78
+ - test/sass/templates/expanded.sass
79
+ - test/sass/templates/import.sass
80
+ - test/sass/templates/subdir
81
+ - test/sass/templates/basic.sass
82
+ - test/sass/templates/nested.sass
83
+ - test/sass/templates/compact.sass
84
+ - test/sass/templates/alt.sass
85
+ - test/sass/templates/constants.sass
86
+ - test/sass/templates/importee.sass
87
+ - test/sass/templates/parent_ref.sass
88
+ - test/sass/templates/bork.sass
89
+ - test/sass/templates/complex.sass
90
+ - test/sass/templates/subdir/subdir.sass
91
+ - test/sass/templates/subdir/nested_subdir
92
+ - test/sass/templates/subdir/nested_subdir/nested_subdir.sass
93
+ - test/sass/results/nested.css
94
+ - test/sass/results/subdir
95
+ - test/sass/results/import.css
96
+ - test/sass/results/compact.css
97
+ - test/sass/results/expanded.css
98
+ - test/sass/results/alt.css
99
+ - test/sass/results/complex.css
100
+ - test/sass/results/constants.css
101
+ - test/sass/results/parent_ref.css
102
+ - test/sass/results/basic.css
103
+ - test/sass/results/subdir/nested_subdir
104
+ - test/sass/results/subdir/subdir.css
105
+ - test/sass/results/subdir/nested_subdir/nested_subdir.css
69
106
  - test/haml/mocks
70
- - test/haml/templates
107
+ - test/haml/template_test.rb
108
+ - test/haml/rhtml
71
109
  - test/haml/helper_test.rb
72
- - test/haml/engine_test.rb
110
+ - test/haml/templates
73
111
  - test/haml/runner.rb
74
- - test/haml/template_test.rb
75
- - test/haml/results/whitespace_handling.xhtml
76
- - test/haml/results/eval_suppressed.xhtml
77
- - test/haml/results/very_basic.xhtml
78
- - test/haml/results/original_engine.xhtml
79
- - test/haml/results/list.xhtml
80
- - test/haml/results/just_stuff.xhtml
81
- - test/haml/results/content_for_layout.xhtml
82
- - test/haml/results/tag_parsing.xhtml
83
- - test/haml/results/helpful.xhtml
84
- - test/haml/results/partials.xhtml
85
- - test/haml/results/standard.xhtml
86
- - test/haml/results/silent_script.xhtml
87
- - test/haml/results/helpers.xhtml
88
- - test/haml/results/filters.xhtml
89
- - test/haml/results/semantic.cache
90
- - test/haml/rhtml/standard.rhtml
112
+ - test/haml/results
113
+ - test/haml/engine_test.rb
91
114
  - test/haml/mocks/article.rb
92
- - test/haml/templates/standard.haml
93
- - test/haml/templates/helpful.haml
94
- - test/haml/templates/whitespace_handling.haml
95
- - test/haml/templates/helpers.haml
96
- - test/haml/templates/partialize.haml
97
- - test/haml/templates/eval_suppressed.haml
115
+ - test/haml/rhtml/standard.rhtml
98
116
  - test/haml/templates/list.haml
99
117
  - test/haml/templates/_text_area.haml
100
- - test/haml/templates/content_for_layout.haml
101
- - test/haml/templates/partials.haml
102
- - test/haml/templates/silent_script.haml
103
- - test/haml/templates/very_basic.haml
104
- - test/haml/templates/original_engine.haml
105
118
  - test/haml/templates/_partial.haml
119
+ - test/haml/templates/helpful.haml
106
120
  - test/haml/templates/just_stuff.haml
121
+ - test/haml/templates/silent_script.haml
122
+ - test/haml/templates/very_basic.haml
123
+ - test/haml/templates/eval_suppressed.haml
107
124
  - test/haml/templates/tag_parsing.haml
125
+ - test/haml/templates/whitespace_handling.haml
126
+ - test/haml/templates/partials.haml
127
+ - test/haml/templates/standard.haml
128
+ - test/haml/templates/partialize.haml
108
129
  - test/haml/templates/filters.haml
130
+ - test/haml/templates/content_for_layout.haml
131
+ - test/haml/templates/helpers.haml
132
+ - test/haml/templates/original_engine.haml
109
133
  - test/haml/templates/breakage.haml
110
- - test/sass/tmp
111
- - test/sass/results
112
- - test/sass/templates
113
- - test/sass/plugin_test.rb
114
- - test/sass/engine_test.rb
115
- - test/sass/results/constants.css
116
- - test/sass/results/basic.css
117
- - test/sass/results/complex.css
118
- - test/sass/results/expanded.css
119
- - test/sass/results/nested.css
120
- - test/sass/results/compact.css
121
- - test/sass/templates/constants.sass
122
- - test/sass/templates/complex.sass
123
- - test/sass/templates/expanded.sass
124
- - test/sass/templates/bork.sass
125
- - test/sass/templates/basic.sass
126
- - test/sass/templates/nested.sass
127
- - test/sass/templates/compact.sass
134
+ - test/haml/results/content_for_layout.xhtml
135
+ - test/haml/results/just_stuff.xhtml
136
+ - test/haml/results/whitespace_handling.xhtml
137
+ - test/haml/results/silent_script.xhtml
138
+ - test/haml/results/filters.xhtml
139
+ - test/haml/results/standard.xhtml
140
+ - test/haml/results/helpful.xhtml
141
+ - test/haml/results/very_basic.xhtml
142
+ - test/haml/results/eval_suppressed.xhtml
143
+ - test/haml/results/partials.xhtml
144
+ - test/haml/results/original_engine.xhtml
145
+ - test/haml/results/helpers.xhtml
146
+ - test/haml/results/list.xhtml
147
+ - test/haml/results/tag_parsing.xhtml
128
148
  - Rakefile
129
149
  - init.rb
130
- - MIT-LICENSE
131
150
  - VERSION
151
+ - MIT-LICENSE
132
152
  - README
133
153
  test_files:
134
- - test/haml/helper_test.rb
135
- - test/haml/engine_test.rb
136
- - test/haml/template_test.rb
137
154
  - test/sass/plugin_test.rb
138
155
  - test/sass/engine_test.rb
156
+ - test/haml/template_test.rb
157
+ - test/haml/helper_test.rb
158
+ - test/haml/engine_test.rb
139
159
  rdoc_options:
140
160
  - --title
141
161
  - Haml
@@ -146,8 +166,8 @@ rdoc_options:
146
166
  - --line-numbers
147
167
  - --inline-source
148
168
  extra_rdoc_files:
149
- - MIT-LICENSE
150
169
  - VERSION
170
+ - MIT-LICENSE
151
171
  - README
152
172
  executables:
153
173
  - haml
@@ -1,15 +0,0 @@
1
- ;; Object results/
2
- ;; SEMANTICDB Tags save file
3
- (semanticdb-project-database-file "results/"
4
- :tables (list
5
- (semanticdb-table "helpers.xhtml"
6
- :major-mode 'html-mode
7
- :tags '(("Big!" section nil nil [566 682]) ("bar" section (:members (("here" section nil nil [801 1277]) ("google" section nil nil [1277 1280]))) nil [682 685]))
8
- :file "helpers.xhtml"
9
- :pointmax 1325
10
- )
11
- )
12
- :file "semantic.cache"
13
- :semantic-tag-version "2.0pre3"
14
- :semanticdb-version "2.0pre3"
15
- )