haml 2.0.0 → 2.0.1
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.
- data/REVISION +1 -0
- data/Rakefile +6 -2
- data/VERSION +1 -1
- data/lib/haml.rb +12 -4
- data/lib/haml/buffer.rb +2 -2
- data/lib/haml/engine.rb +12 -5
- data/lib/haml/error.rb +4 -5
- data/lib/haml/exec.rb +4 -2
- data/lib/haml/helpers.rb +39 -22
- data/lib/haml/helpers/action_view_mods.rb +72 -35
- data/lib/haml/precompiler.rb +17 -26
- data/lib/haml/template.rb +11 -3
- data/lib/haml/template/patch.rb +1 -1
- data/lib/sass.rb +26 -3
- data/lib/sass/constant.rb +26 -57
- data/lib/sass/constant/literal.rb +1 -0
- data/lib/sass/constant/nil.rb +9 -0
- data/lib/sass/engine.rb +10 -4
- data/test/haml/engine_test.rb +20 -1
- data/test/haml/helper_test.rb +18 -2
- data/test/haml/html2haml_test.rb +1 -3
- data/test/haml/results/helpers.xhtml +2 -5
- data/test/haml/results/just_stuff.xhtml +0 -1
- data/test/haml/results/nuke_inner_whitespace.xhtml +6 -0
- data/test/haml/results/whitespace_handling.xhtml +1 -1
- data/test/haml/template_test.rb +29 -46
- data/test/haml/templates/helpers.haml +1 -1
- data/test/haml/templates/just_stuff.haml +0 -1
- data/test/haml/templates/nuke_inner_whitespace.haml +6 -0
- data/test/haml/templates/partials.haml +1 -1
- data/test/haml/templates/whitespace_handling.haml +10 -10
- data/test/sass/engine_test.rb +11 -5
- data/test/sass/plugin_test.rb +2 -6
- data/test/sass/results/constants.css +2 -0
- data/test/sass/templates/constants.sass +3 -0
- data/test/{haml/test_helper.rb → test_helper.rb} +4 -3
- metadata +102 -99
@@ -1,9 +1,9 @@
|
|
1
1
|
#whitespace_test
|
2
|
-
=
|
3
|
-
=
|
4
|
-
~
|
5
|
-
~
|
6
|
-
#flattened~
|
2
|
+
= test_partial "text_area", :value => "Oneline"
|
3
|
+
= test_partial "text_area", :value => "Two\nlines"
|
4
|
+
~ test_partial "text_area", :value => "Oneline"
|
5
|
+
~ test_partial "text_area", :value => "Two\nlines"
|
6
|
+
#flattened~ test_partial "text_area", :value => "Two\nlines"
|
7
7
|
.hithere
|
8
8
|
~ "Foo bar"
|
9
9
|
~ "<pre>foo bar</pre>"
|
@@ -15,11 +15,11 @@
|
|
15
15
|
~ ['a', 'b', 'c'].map do |a|
|
16
16
|
- "<textarea>\n#{a}\n</textarea>"
|
17
17
|
#whitespace_test
|
18
|
-
=
|
19
|
-
=
|
20
|
-
= find_and_preserve
|
21
|
-
= find_and_preserve
|
22
|
-
#flattened= find_and_preserve
|
18
|
+
= test_partial "text_area", :value => "Oneline"
|
19
|
+
= test_partial "text_area", :value => "Two\nlines"
|
20
|
+
= find_and_preserve test_partial("text_area", :value => "Oneline")
|
21
|
+
= find_and_preserve test_partial("text_area", :value => "Two\nlines")
|
22
|
+
#flattened= find_and_preserve test_partial("text_area", :value => "Two\nlines")
|
23
23
|
.hithere
|
24
24
|
= find_and_preserve("Foo bar")
|
25
25
|
= find_and_preserve("<pre>foo bar</pre>")
|
data/test/sass/engine_test.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require File.dirname(__FILE__) + '/../../lib/sass'
|
2
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
5
3
|
require 'sass/engine'
|
6
4
|
|
7
5
|
class SassEngineTest < Test::Unit::TestCase
|
@@ -58,6 +56,8 @@ END
|
|
58
56
|
"=foo\n :color red\n.bar\n +bang" => "Undefined mixin 'bang'.",
|
59
57
|
".bar\n =foo\n :color red\n" => "Mixins may only be defined at the root of a document.",
|
60
58
|
"=foo\n :color red\n.bar\n +foo\n :color red" => "Illegal nesting: Nothing may be nested beneath mixin directives.",
|
59
|
+
" a\n b: c" => ["Indenting at the beginning of the document is illegal.", 1],
|
60
|
+
" \n \n\t\n a\n b: c" => ["Indenting at the beginning of the document is illegal.", 4],
|
61
61
|
|
62
62
|
# Regression tests
|
63
63
|
"a\n b:\n c\n d" => ["Illegal nesting: Only attributes may be nested beneath attributes.", 3]
|
@@ -130,8 +130,8 @@ END
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def test_default_function
|
133
|
-
assert_equal("foo {\n bar: url(foo.png); }\n",
|
134
|
-
|
133
|
+
assert_equal("foo {\n bar: url(foo.png); }\n", render("foo\n bar = url(foo.png)\n"));
|
134
|
+
assert_equal("foo {\n bar: url(); }\n", render("foo\n bar = url()\n"));
|
135
135
|
end
|
136
136
|
|
137
137
|
def test_basic_multiline_selector
|
@@ -255,6 +255,12 @@ END
|
|
255
255
|
renders_correctly "mixins", { :style => :expanded }
|
256
256
|
end
|
257
257
|
|
258
|
+
def test_mixins_dont_interfere_with_sibling_combinator
|
259
|
+
assert_equal("foo + bar {\n a: b; }\n", render("foo\n + bar\n a: b"))
|
260
|
+
assert_equal("foo + bar {\n a: b; }\nfoo + baz {\n c: d; }\n",
|
261
|
+
render("foo\n +\n bar\n a: b\n baz\n c: d"))
|
262
|
+
end
|
263
|
+
|
258
264
|
private
|
259
265
|
|
260
266
|
def render(sass, options = {})
|
data/test/sass/plugin_test.rb
CHANGED
@@ -3,13 +3,9 @@
|
|
3
3
|
MERB_ENV = RAILS_ENV = 'testing'
|
4
4
|
RAILS_ROOT = '.'
|
5
5
|
|
6
|
-
require '
|
7
|
-
require 'fileutils'
|
8
|
-
require File.dirname(__FILE__) + '/../../lib/sass'
|
9
|
-
require 'rubygems'
|
10
|
-
|
11
|
-
require 'action_controller'
|
6
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
12
7
|
require 'sass/plugin'
|
8
|
+
require 'fileutils'
|
13
9
|
|
14
10
|
class SassPluginTest < Test::Unit::TestCase
|
15
11
|
@@templates = %w{
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# allows testing with edge Rails by creating a test/rails symlink
|
2
|
-
linked_rails = File.dirname(__FILE__) + '
|
2
|
+
linked_rails = File.dirname(__FILE__) + '/rails'
|
3
3
|
|
4
|
-
if File.exists? linked_rails
|
4
|
+
if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib')
|
5
5
|
puts "[ using linked Rails ]"
|
6
6
|
$:.unshift linked_rails + '/activesupport/lib'
|
7
7
|
$:.unshift linked_rails + '/actionpack/lib'
|
@@ -12,4 +12,5 @@ require 'action_controller'
|
|
12
12
|
require 'action_view'
|
13
13
|
|
14
14
|
require 'test/unit'
|
15
|
-
require File.dirname(__FILE__) + '
|
15
|
+
require File.dirname(__FILE__) + '/../lib/haml'
|
16
|
+
require File.dirname(__FILE__) + '/../lib/sass'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2008-
|
13
|
+
date: 2008-06-28 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -24,159 +24,162 @@ executables:
|
|
24
24
|
extensions: []
|
25
25
|
|
26
26
|
extra_rdoc_files:
|
27
|
-
-
|
27
|
+
- FAQ
|
28
28
|
- MIT-LICENSE
|
29
|
+
- VERSION
|
29
30
|
- README.rdoc
|
30
|
-
-
|
31
|
+
- REVISION
|
31
32
|
files:
|
32
33
|
- lib/sass.rb
|
33
34
|
- lib/sass
|
34
|
-
- lib/sass/
|
35
|
-
- lib/sass/plugin/rails.rb
|
36
|
-
- lib/sass/plugin/merb.rb
|
35
|
+
- lib/sass/css.rb
|
37
36
|
- lib/sass/error.rb
|
38
37
|
- lib/sass/tree
|
38
|
+
- lib/sass/tree/comment_node.rb
|
39
|
+
- lib/sass/tree/node.rb
|
39
40
|
- lib/sass/tree/value_node.rb
|
40
|
-
- lib/sass/tree/attr_node.rb
|
41
41
|
- lib/sass/tree/directive_node.rb
|
42
|
-
- lib/sass/tree/
|
43
|
-
- lib/sass/tree/comment_node.rb
|
42
|
+
- lib/sass/tree/attr_node.rb
|
44
43
|
- lib/sass/tree/rule_node.rb
|
44
|
+
- lib/sass/plugin
|
45
|
+
- lib/sass/plugin/rails.rb
|
46
|
+
- lib/sass/plugin/merb.rb
|
45
47
|
- lib/sass/constant.rb
|
48
|
+
- lib/sass/engine.rb
|
49
|
+
- lib/sass/plugin.rb
|
46
50
|
- lib/sass/constant
|
47
|
-
- lib/sass/constant/color.rb
|
48
|
-
- lib/sass/constant/string.rb
|
49
51
|
- lib/sass/constant/number.rb
|
50
52
|
- lib/sass/constant/operation.rb
|
51
53
|
- lib/sass/constant/literal.rb
|
52
|
-
- lib/sass/
|
53
|
-
- lib/sass/
|
54
|
-
- lib/sass/
|
54
|
+
- lib/sass/constant/color.rb
|
55
|
+
- lib/sass/constant/string.rb
|
56
|
+
- lib/sass/constant/nil.rb
|
55
57
|
- lib/haml
|
58
|
+
- lib/haml/filters.rb
|
56
59
|
- lib/haml/exec.rb
|
57
|
-
- lib/haml/html.rb
|
58
60
|
- lib/haml/error.rb
|
59
|
-
- lib/haml/buffer.rb
|
60
61
|
- lib/haml/template.rb
|
62
|
+
- lib/haml/engine.rb
|
61
63
|
- lib/haml/template
|
62
|
-
- lib/haml/template/plugin.rb
|
63
64
|
- lib/haml/template/patch.rb
|
65
|
+
- lib/haml/template/plugin.rb
|
64
66
|
- lib/haml/helpers.rb
|
65
|
-
- lib/haml/
|
66
|
-
- lib/haml/
|
67
|
+
- lib/haml/buffer.rb
|
68
|
+
- lib/haml/html.rb
|
67
69
|
- lib/haml/precompiler.rb
|
68
70
|
- lib/haml/helpers
|
69
|
-
- lib/haml/helpers/action_view_extensions.rb
|
70
71
|
- lib/haml/helpers/action_view_mods.rb
|
72
|
+
- lib/haml/helpers/action_view_extensions.rb
|
71
73
|
- lib/haml.rb
|
72
|
-
- bin/css2sass
|
73
74
|
- bin/sass
|
74
|
-
- bin/
|
75
|
+
- bin/css2sass
|
75
76
|
- bin/html2haml
|
77
|
+
- bin/haml
|
78
|
+
- test/benchmark.rb
|
76
79
|
- test/sass
|
80
|
+
- test/sass/results
|
81
|
+
- test/sass/results/constants.css
|
82
|
+
- test/sass/results/parent_ref.css
|
83
|
+
- test/sass/results/compressed.css
|
84
|
+
- test/sass/results/complex.css
|
85
|
+
- test/sass/results/compact.css
|
86
|
+
- test/sass/results/mixins.css
|
87
|
+
- test/sass/results/alt.css
|
88
|
+
- test/sass/results/subdir
|
89
|
+
- test/sass/results/subdir/subdir.css
|
90
|
+
- test/sass/results/subdir/nested_subdir
|
91
|
+
- test/sass/results/subdir/nested_subdir/nested_subdir.css
|
92
|
+
- test/sass/results/nested.css
|
93
|
+
- test/sass/results/import.css
|
94
|
+
- test/sass/results/multiline.css
|
95
|
+
- test/sass/results/basic.css
|
96
|
+
- test/sass/results/expanded.css
|
77
97
|
- test/sass/templates
|
78
|
-
- test/sass/templates/
|
98
|
+
- test/sass/templates/basic.sass
|
99
|
+
- test/sass/templates/bork.sass
|
79
100
|
- test/sass/templates/compressed.sass
|
80
|
-
- test/sass/templates/expanded.sass
|
81
101
|
- test/sass/templates/import.sass
|
102
|
+
- test/sass/templates/constants.sass
|
103
|
+
- test/sass/templates/expanded.sass
|
104
|
+
- test/sass/templates/nested.sass
|
105
|
+
- test/sass/templates/_partial.sass
|
106
|
+
- test/sass/templates/compact.sass
|
82
107
|
- test/sass/templates/subdir
|
83
108
|
- test/sass/templates/subdir/subdir.sass
|
84
109
|
- test/sass/templates/subdir/nested_subdir
|
85
110
|
- test/sass/templates/subdir/nested_subdir/nested_subdir.sass
|
86
|
-
- test/sass/templates/
|
87
|
-
- test/sass/templates/_partial.sass
|
88
|
-
- test/sass/templates/mixins.sass
|
89
|
-
- test/sass/templates/multiline.sass
|
90
|
-
- test/sass/templates/nested.sass
|
91
|
-
- test/sass/templates/compact.sass
|
111
|
+
- test/sass/templates/parent_ref.sass
|
92
112
|
- test/sass/templates/alt.sass
|
93
|
-
- test/sass/templates/constants.sass
|
94
113
|
- test/sass/templates/importee.sass
|
95
|
-
- test/sass/templates/
|
96
|
-
- test/sass/templates/
|
114
|
+
- test/sass/templates/mixins.sass
|
115
|
+
- test/sass/templates/multiline.sass
|
97
116
|
- test/sass/templates/complex.sass
|
98
|
-
- test/sass/
|
99
|
-
- test/sass/results
|
100
|
-
- test/sass/results/nested.css
|
101
|
-
- test/sass/results/subdir
|
102
|
-
- test/sass/results/subdir/nested_subdir
|
103
|
-
- test/sass/results/subdir/nested_subdir/nested_subdir.css
|
104
|
-
- test/sass/results/subdir/subdir.css
|
105
|
-
- test/sass/results/import.css
|
106
|
-
- test/sass/results/compact.css
|
107
|
-
- test/sass/results/expanded.css
|
108
|
-
- test/sass/results/alt.css
|
109
|
-
- test/sass/results/mixins.css
|
110
|
-
- test/sass/results/complex.css
|
111
|
-
- test/sass/results/constants.css
|
112
|
-
- test/sass/results/compressed.css
|
113
|
-
- test/sass/results/parent_ref.css
|
114
|
-
- test/sass/results/multiline.css
|
115
|
-
- test/sass/results/basic.css
|
117
|
+
- test/sass/templates/bork2.sass
|
116
118
|
- test/sass/engine_test.rb
|
119
|
+
- test/sass/plugin_test.rb
|
117
120
|
- test/haml
|
118
121
|
- test/haml/mocks
|
119
122
|
- test/haml/mocks/article.rb
|
120
|
-
- test/haml/template_test.rb
|
121
|
-
- test/haml/html2haml_test.rb
|
122
123
|
- test/haml/rhtml
|
123
|
-
- test/haml/rhtml/
|
124
|
+
- test/haml/rhtml/_av_partial_2.rhtml
|
124
125
|
- test/haml/rhtml/standard.rhtml
|
126
|
+
- test/haml/rhtml/_av_partial_1.rhtml
|
125
127
|
- test/haml/rhtml/action_view.rhtml
|
126
|
-
- test/haml/
|
128
|
+
- test/haml/html2haml_test.rb
|
129
|
+
- test/haml/template_test.rb
|
127
130
|
- test/haml/helper_test.rb
|
128
|
-
- test/haml/templates
|
129
|
-
- test/haml/templates/list.haml
|
130
|
-
- test/haml/templates/_text_area.haml
|
131
|
-
- test/haml/templates/_partial.haml
|
132
|
-
- test/haml/templates/nuke_outer_whitespace.haml
|
133
|
-
- test/haml/templates/_av_partial_2.haml
|
134
|
-
- test/haml/templates/helpful.haml
|
135
|
-
- test/haml/templates/just_stuff.haml
|
136
|
-
- test/haml/templates/silent_script.haml
|
137
|
-
- test/haml/templates/very_basic.haml
|
138
|
-
- test/haml/templates/nuke_inner_whitespace.haml
|
139
|
-
- test/haml/templates/eval_suppressed.haml
|
140
|
-
- test/haml/templates/tag_parsing.haml
|
141
|
-
- test/haml/templates/whitespace_handling.haml
|
142
|
-
- test/haml/templates/partials.haml
|
143
|
-
- test/haml/templates/standard.haml
|
144
|
-
- test/haml/templates/partialize.haml
|
145
|
-
- test/haml/templates/_av_partial_1.haml
|
146
|
-
- test/haml/templates/filters.haml
|
147
|
-
- test/haml/templates/content_for_layout.haml
|
148
|
-
- test/haml/templates/helpers.haml
|
149
|
-
- test/haml/templates/original_engine.haml
|
150
|
-
- test/haml/templates/breakage.haml
|
151
|
-
- test/haml/templates/action_view.haml
|
152
|
-
- test/haml/test_helper.rb
|
153
131
|
- test/haml/results
|
132
|
+
- test/haml/results/tag_parsing.xhtml
|
154
133
|
- test/haml/results/content_for_layout.xhtml
|
155
|
-
- test/haml/results/
|
134
|
+
- test/haml/results/helpers.xhtml
|
135
|
+
- test/haml/results/original_engine.xhtml
|
136
|
+
- test/haml/results/very_basic.xhtml
|
137
|
+
- test/haml/results/helpful.xhtml
|
138
|
+
- test/haml/results/list.xhtml
|
139
|
+
- test/haml/results/partials.xhtml
|
140
|
+
- test/haml/results/eval_suppressed.xhtml
|
141
|
+
- test/haml/results/nuke_inner_whitespace.xhtml
|
156
142
|
- test/haml/results/whitespace_handling.xhtml
|
157
|
-
- test/haml/results/nuke_outer_whitespace.xhtml
|
158
143
|
- test/haml/results/silent_script.xhtml
|
159
|
-
- test/haml/results/filters.xhtml
|
160
144
|
- test/haml/results/standard.xhtml
|
161
|
-
- test/haml/results/
|
162
|
-
- test/haml/results/
|
163
|
-
- test/haml/results/
|
164
|
-
- test/haml/results/eval_suppressed.xhtml
|
165
|
-
- test/haml/results/partials.xhtml
|
166
|
-
- test/haml/results/original_engine.xhtml
|
167
|
-
- test/haml/results/helpers.xhtml
|
168
|
-
- test/haml/results/list.xhtml
|
169
|
-
- test/haml/results/tag_parsing.xhtml
|
145
|
+
- test/haml/results/just_stuff.xhtml
|
146
|
+
- test/haml/results/filters.xhtml
|
147
|
+
- test/haml/results/nuke_outer_whitespace.xhtml
|
170
148
|
- test/haml/markaby
|
171
149
|
- test/haml/markaby/standard.mab
|
150
|
+
- test/haml/templates
|
151
|
+
- test/haml/templates/tag_parsing.haml
|
152
|
+
- test/haml/templates/nuke_inner_whitespace.haml
|
153
|
+
- test/haml/templates/partials.haml
|
154
|
+
- test/haml/templates/original_engine.haml
|
155
|
+
- test/haml/templates/helpers.haml
|
156
|
+
- test/haml/templates/content_for_layout.haml
|
157
|
+
- test/haml/templates/silent_script.haml
|
158
|
+
- test/haml/templates/very_basic.haml
|
159
|
+
- test/haml/templates/filters.haml
|
160
|
+
- test/haml/templates/_av_partial_1.haml
|
161
|
+
- test/haml/templates/_partial.haml
|
162
|
+
- test/haml/templates/nuke_outer_whitespace.haml
|
163
|
+
- test/haml/templates/breakage.haml
|
164
|
+
- test/haml/templates/list.haml
|
165
|
+
- test/haml/templates/standard.haml
|
166
|
+
- test/haml/templates/whitespace_handling.haml
|
167
|
+
- test/haml/templates/eval_suppressed.haml
|
168
|
+
- test/haml/templates/action_view.haml
|
169
|
+
- test/haml/templates/_av_partial_2.haml
|
170
|
+
- test/haml/templates/partialize.haml
|
171
|
+
- test/haml/templates/just_stuff.haml
|
172
|
+
- test/haml/templates/helpful.haml
|
173
|
+
- test/haml/templates/_text_area.haml
|
172
174
|
- test/haml/engine_test.rb
|
173
|
-
- test/
|
175
|
+
- test/test_helper.rb
|
174
176
|
- Rakefile
|
175
177
|
- init.rb
|
176
|
-
-
|
178
|
+
- FAQ
|
177
179
|
- MIT-LICENSE
|
180
|
+
- VERSION
|
178
181
|
- README.rdoc
|
179
|
-
-
|
182
|
+
- REVISION
|
180
183
|
has_rdoc: true
|
181
184
|
homepage: http://haml.hamptoncatlin.com/
|
182
185
|
post_install_message:
|
@@ -206,14 +209,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
209
|
requirements: []
|
207
210
|
|
208
211
|
rubyforge_project: haml
|
209
|
-
rubygems_version: 1.
|
212
|
+
rubygems_version: 1.2.0
|
210
213
|
signing_key:
|
211
214
|
specification_version: 2
|
212
215
|
summary: An elegant, structured XHTML/XML templating engine. Comes with Sass, a similar CSS templating engine.
|
213
216
|
test_files:
|
214
|
-
- test/sass/plugin_test.rb
|
215
217
|
- test/sass/engine_test.rb
|
216
|
-
- test/
|
218
|
+
- test/sass/plugin_test.rb
|
217
219
|
- test/haml/html2haml_test.rb
|
220
|
+
- test/haml/template_test.rb
|
218
221
|
- test/haml/helper_test.rb
|
219
222
|
- test/haml/engine_test.rb
|