haml 1.7.2 → 1.8.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 (71) hide show
  1. data/README +17 -9
  2. data/Rakefile +12 -4
  3. data/VERSION +1 -1
  4. data/init.rb +1 -6
  5. data/lib/haml.rb +65 -7
  6. data/lib/haml/buffer.rb +49 -84
  7. data/lib/haml/engine.rb +155 -797
  8. data/lib/haml/error.rb +3 -33
  9. data/lib/haml/exec.rb +86 -65
  10. data/lib/haml/filters.rb +57 -27
  11. data/lib/haml/helpers.rb +52 -9
  12. data/lib/haml/helpers/action_view_mods.rb +1 -1
  13. data/lib/haml/html.rb +20 -5
  14. data/lib/haml/precompiler.rb +671 -0
  15. data/lib/haml/template.rb +20 -73
  16. data/lib/haml/template/patch.rb +51 -0
  17. data/lib/haml/template/plugin.rb +21 -0
  18. data/lib/sass.rb +78 -3
  19. data/lib/sass/constant.rb +45 -19
  20. data/lib/sass/constant.rb.rej +42 -0
  21. data/lib/sass/constant/string.rb +4 -0
  22. data/lib/sass/css.rb +162 -39
  23. data/lib/sass/engine.rb +38 -14
  24. data/lib/sass/plugin.rb +79 -44
  25. data/lib/sass/tree/attr_node.rb +12 -11
  26. data/lib/sass/tree/comment_node.rb +9 -3
  27. data/lib/sass/tree/directive_node.rb +51 -0
  28. data/lib/sass/tree/node.rb +13 -6
  29. data/lib/sass/tree/rule_node.rb +34 -12
  30. data/test/benchmark.rb +85 -52
  31. data/test/haml/engine_test.rb +172 -84
  32. data/test/haml/helper_test.rb +31 -3
  33. data/test/haml/html2haml_test.rb +60 -0
  34. data/test/haml/markaby/standard.mab +52 -0
  35. data/test/haml/results/eval_suppressed.xhtml +4 -1
  36. data/test/haml/results/helpers.xhtml +15 -4
  37. data/test/haml/results/just_stuff.xhtml +9 -1
  38. data/test/haml/results/standard.xhtml +0 -1
  39. data/test/haml/rhtml/_av_partial_1.rhtml +12 -0
  40. data/test/haml/rhtml/_av_partial_2.rhtml +8 -0
  41. data/test/haml/rhtml/action_view.rhtml +62 -0
  42. data/test/haml/rhtml/standard.rhtml +0 -1
  43. data/test/haml/template_test.rb +41 -21
  44. data/test/haml/templates/_av_partial_1.haml +9 -0
  45. data/test/haml/templates/_av_partial_2.haml +5 -0
  46. data/test/haml/templates/action_view.haml +47 -0
  47. data/test/haml/templates/eval_suppressed.haml +1 -0
  48. data/test/haml/templates/helpers.haml +9 -3
  49. data/test/haml/templates/just_stuff.haml +10 -1
  50. data/test/haml/templates/partials.haml +1 -1
  51. data/test/haml/templates/standard.haml +0 -1
  52. data/test/profile.rb +2 -2
  53. data/test/sass/engine_test.rb +113 -3
  54. data/test/sass/engine_test.rb.rej +18 -0
  55. data/test/sass/plugin_test.rb +34 -11
  56. data/test/sass/results/compact.css +1 -1
  57. data/test/sass/results/complex.css +1 -1
  58. data/test/sass/results/compressed.css +1 -0
  59. data/test/sass/results/constants.css +3 -1
  60. data/test/sass/results/expanded.css +2 -1
  61. data/test/sass/results/import.css +2 -0
  62. data/test/sass/results/nested.css +2 -1
  63. data/test/sass/templates/_partial.sass +2 -0
  64. data/test/sass/templates/compact.sass +2 -0
  65. data/test/sass/templates/complex.sass +1 -0
  66. data/test/sass/templates/compressed.sass +15 -0
  67. data/test/sass/templates/constants.sass +9 -0
  68. data/test/sass/templates/expanded.sass +2 -0
  69. data/test/sass/templates/import.sass +1 -1
  70. data/test/sass/templates/nested.sass +2 -0
  71. metadata +22 -2
@@ -0,0 +1 @@
1
+ #main{width:15em;color:#0000ff}#main p{border-style:dotted;border-width:2px}#main .cool{width:100px}#left{font-size:2em;font-weight:bold;float:left}
@@ -3,10 +3,12 @@
3
3
 
4
4
  #plus { num-num: 7; num-num-un: 25em; num-num-un2: 23em; num-num-neg: 9.87; num-str: 100px; num-col: #b7b7b7; num-perc: 31%; str-str: hi there; str-str2: hi there; str-col: 14em solid #112233; str-num: times: 13; col-num: #ff7b9d; col-col: #5173ff; }
5
5
 
6
- #minus { num-num: 900; col-num: #f9f9f4; col-col: #000035; unary-num: -1; unary-const: 10; unary-paren: -11; }
6
+ #minus { num-num: 900; col-num: #f9f9f4; col-col: #000035; unary-num: -1; unary-const: 10; unary-paren: -11; unary-two: 12; unary-many: 12; unary-crazy: -15; }
7
7
 
8
8
  #times { num-num: 7; num-col: #7496b8; col-num: #092345; col-col: #243648; }
9
9
 
10
10
  #div { num-num: 3.33333333333333; num-num2: 3; col-num: #092345; col-col: #0b0d0f; }
11
11
 
12
12
  #mod { num-num: 2; col-col: #0f0e05; col-num: #020001; }
13
+
14
+ #const { escaped-quote: !foo; escaped-slash: !foo; default: Hello! !important; }
@@ -4,6 +4,8 @@
4
4
  }
5
5
  #main p {
6
6
  border-style: dotted;
7
+ /* Nested comment
8
+ * More nested stuff */
7
9
  border-width: 2px;
8
10
  }
9
11
  #main .cool {
@@ -13,6 +15,5 @@
13
15
  #left {
14
16
  font-size: 2em;
15
17
  font-weight: bold;
16
-
17
18
  float: left;
18
19
  }
@@ -24,4 +24,6 @@ body { font: Arial; background: blue; }
24
24
 
25
25
  @import url(basic.css);
26
26
  @import url(../results/complex.css);
27
+ #foo { background-color: #baf; }
28
+
27
29
  nonimported { myconst: hello; otherconst: goodbye; }
@@ -3,6 +3,8 @@
3
3
  color: #0000ff; }
4
4
  #main p {
5
5
  border-style: dotted;
6
+ /* Nested comment
7
+ * More nested stuff */
6
8
  border-width: 2px; }
7
9
  #main .cool {
8
10
  width: 100px; }
@@ -10,7 +12,6 @@
10
12
  #left {
11
13
  font-size: 2em;
12
14
  font-weight: bold;
13
-
14
15
  float: left; }
15
16
 
16
17
  #right .header {
@@ -0,0 +1,2 @@
1
+ #foo
2
+ :background-color #baf
@@ -4,6 +4,8 @@
4
4
  p
5
5
  :border
6
6
  :style dotted
7
+ /* Nested comment
8
+ More nested stuff
7
9
  :width 2px
8
10
  .cool
9
11
  :width 100px
@@ -23,6 +23,7 @@ body
23
23
  :margin 0
24
24
  :background
25
25
  :image url(/images/global_logo.gif)
26
+ /* Crazy nested comment
26
27
  :repeat no-repeat
27
28
  :text-indent -9999px
28
29
  .status
@@ -0,0 +1,15 @@
1
+ #main
2
+ :width 15em
3
+ :color #0000ff
4
+ p
5
+ :border
6
+ :style dotted
7
+ :width 2px
8
+ .cool
9
+ :width 100px
10
+
11
+ #left
12
+ :font
13
+ :size 2em
14
+ :weight bold
15
+ :float left
@@ -63,6 +63,9 @@
63
63
  :num= -1
64
64
  :const= -!neg
65
65
  :paren= -(5 + 6)
66
+ :two= --12
67
+ :many= --------12
68
+ :crazy= -----(5 + ---!neg)
66
69
 
67
70
  #times
68
71
  :num
@@ -86,3 +89,9 @@
86
89
  :col
87
90
  :col= #5f6e7d % #10200a
88
91
  :num= #aaabac % 3
92
+
93
+ #const
94
+ :escaped
95
+ :quote = "!foo"
96
+ :slash = \!foo
97
+ :default = !str !important
@@ -4,6 +4,8 @@
4
4
  p
5
5
  :border
6
6
  :style dotted
7
+ /* Nested comment
8
+ More nested stuff
7
9
  :width 2px
8
10
  .cool
9
11
  :width 100px
@@ -1,6 +1,6 @@
1
1
  !preconst = hello
2
2
 
3
- @import importee, basic, basic.css, ../results/complex.css
3
+ @import importee, basic, basic.css, ../results/complex.css, partial
4
4
 
5
5
  nonimported
6
6
  :myconst = !preconst
@@ -4,6 +4,8 @@
4
4
  p
5
5
  :border
6
6
  :style dotted
7
+ /* Nested comment
8
+ More nested stuff
7
9
  :width 2px
8
10
  .cool
9
11
  :width 100px
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: haml
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.7.2
7
- date: 2007-11-18 00:00:00 -08:00
6
+ version: 1.8.0
7
+ date: 2008-01-06 00:00:00 -08: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
@@ -36,10 +36,12 @@ files:
36
36
  - lib/sass/plugin
37
37
  - lib/sass/plugin/rails.rb
38
38
  - lib/sass/plugin/merb.rb
39
+ - lib/sass/constant.rb.rej
39
40
  - lib/sass/error.rb
40
41
  - lib/sass/tree
41
42
  - lib/sass/tree/value_node.rb
42
43
  - lib/sass/tree/attr_node.rb
44
+ - lib/sass/tree/directive_node.rb
43
45
  - lib/sass/tree/node.rb
44
46
  - lib/sass/tree/comment_node.rb
45
47
  - lib/sass/tree/rule_node.rb
@@ -60,9 +62,13 @@ files:
60
62
  - lib/haml/error.rb
61
63
  - lib/haml/buffer.rb
62
64
  - lib/haml/template.rb
65
+ - lib/haml/template
66
+ - lib/haml/template/plugin.rb
67
+ - lib/haml/template/patch.rb
63
68
  - lib/haml/helpers.rb
64
69
  - lib/haml/filters.rb
65
70
  - lib/haml/engine.rb
71
+ - lib/haml/precompiler.rb
66
72
  - lib/haml/helpers
67
73
  - lib/haml/helpers/action_view_extensions.rb
68
74
  - lib/haml/helpers/action_view_mods.rb.rej
@@ -75,6 +81,7 @@ files:
75
81
  - test/sass
76
82
  - test/sass/templates
77
83
  - test/sass/templates/bork2.sass
84
+ - test/sass/templates/compressed.sass
78
85
  - test/sass/templates/expanded.sass
79
86
  - test/sass/templates/import.sass
80
87
  - test/sass/templates/subdir
@@ -82,6 +89,7 @@ files:
82
89
  - test/sass/templates/subdir/nested_subdir
83
90
  - test/sass/templates/subdir/nested_subdir/nested_subdir.sass
84
91
  - test/sass/templates/basic.sass
92
+ - test/sass/templates/_partial.sass
85
93
  - test/sass/templates/nested.sass
86
94
  - test/sass/templates/compact.sass
87
95
  - test/sass/templates/alt.sass
@@ -103,20 +111,27 @@ files:
103
111
  - test/sass/results/alt.css
104
112
  - test/sass/results/complex.css
105
113
  - test/sass/results/constants.css
114
+ - test/sass/results/compressed.css
106
115
  - test/sass/results/parent_ref.css
107
116
  - test/sass/results/basic.css
117
+ - test/sass/engine_test.rb.rej
108
118
  - test/sass/engine_test.rb
109
119
  - test/haml
110
120
  - test/haml/mocks
111
121
  - test/haml/mocks/article.rb
112
122
  - test/haml/template_test.rb
123
+ - test/haml/html2haml_test.rb
113
124
  - test/haml/rhtml
125
+ - test/haml/rhtml/_av_partial_1.rhtml
114
126
  - test/haml/rhtml/standard.rhtml
127
+ - test/haml/rhtml/action_view.rhtml
128
+ - test/haml/rhtml/_av_partial_2.rhtml
115
129
  - test/haml/helper_test.rb
116
130
  - test/haml/templates
117
131
  - test/haml/templates/list.haml
118
132
  - test/haml/templates/_text_area.haml
119
133
  - test/haml/templates/_partial.haml
134
+ - test/haml/templates/_av_partial_2.haml
120
135
  - test/haml/templates/helpful.haml
121
136
  - test/haml/templates/just_stuff.haml
122
137
  - test/haml/templates/silent_script.haml
@@ -127,11 +142,13 @@ files:
127
142
  - test/haml/templates/partials.haml
128
143
  - test/haml/templates/standard.haml
129
144
  - test/haml/templates/partialize.haml
145
+ - test/haml/templates/_av_partial_1.haml
130
146
  - test/haml/templates/filters.haml
131
147
  - test/haml/templates/content_for_layout.haml
132
148
  - test/haml/templates/helpers.haml
133
149
  - test/haml/templates/original_engine.haml
134
150
  - test/haml/templates/breakage.haml
151
+ - test/haml/templates/action_view.haml
135
152
  - test/haml/runner.rb
136
153
  - test/haml/results
137
154
  - test/haml/results/content_for_layout.xhtml
@@ -148,6 +165,8 @@ files:
148
165
  - test/haml/results/helpers.xhtml
149
166
  - test/haml/results/list.xhtml
150
167
  - test/haml/results/tag_parsing.xhtml
168
+ - test/haml/markaby
169
+ - test/haml/markaby/standard.mab
151
170
  - test/haml/engine_test.rb
152
171
  - test/profile.rb
153
172
  - test/benchmark.rb
@@ -160,6 +179,7 @@ test_files:
160
179
  - test/sass/plugin_test.rb
161
180
  - test/sass/engine_test.rb
162
181
  - test/haml/template_test.rb
182
+ - test/haml/html2haml_test.rb
163
183
  - test/haml/helper_test.rb
164
184
  - test/haml/engine_test.rb
165
185
  rdoc_options: