haml-edge 2.3.179 → 2.3.180
Sign up to get free protection for your applications and to get access to all the features.
- data/EDGE_GEM_VERSION +1 -1
- data/README.md +88 -149
- data/VERSION +1 -1
- data/bin/css2sass +7 -1
- data/bin/sass-convert +7 -0
- data/lib/haml/exec.rb +95 -22
- data/lib/haml/template.rb +1 -1
- data/lib/haml/util.rb +50 -0
- data/lib/sass.rb +1 -1
- data/lib/sass/css.rb +38 -210
- data/lib/sass/engine.rb +121 -47
- data/lib/sass/files.rb +28 -19
- data/lib/sass/plugin.rb +32 -43
- data/lib/sass/repl.rb +1 -1
- data/lib/sass/script.rb +25 -6
- data/lib/sass/script/bool.rb +1 -0
- data/lib/sass/script/color.rb +2 -2
- data/lib/sass/script/css_lexer.rb +22 -0
- data/lib/sass/script/css_parser.rb +28 -0
- data/lib/sass/script/funcall.rb +17 -9
- data/lib/sass/script/functions.rb +46 -1
- data/lib/sass/script/interpolation.rb +42 -0
- data/lib/sass/script/lexer.rb +142 -34
- data/lib/sass/script/literal.rb +28 -12
- data/lib/sass/script/node.rb +57 -1
- data/lib/sass/script/number.rb +18 -3
- data/lib/sass/script/operation.rb +44 -8
- data/lib/sass/script/parser.rb +149 -24
- data/lib/sass/script/string.rb +50 -2
- data/lib/sass/script/unary_operation.rb +25 -10
- data/lib/sass/script/variable.rb +20 -11
- data/lib/sass/scss.rb +14 -0
- data/lib/sass/scss/css_parser.rb +39 -0
- data/lib/sass/scss/parser.rb +683 -0
- data/lib/sass/scss/rx.rb +112 -0
- data/lib/sass/scss/script_lexer.rb +13 -0
- data/lib/sass/scss/script_parser.rb +25 -0
- data/lib/sass/tree/comment_node.rb +58 -16
- data/lib/sass/tree/debug_node.rb +7 -2
- data/lib/sass/tree/directive_node.rb +38 -34
- data/lib/sass/tree/for_node.rb +6 -0
- data/lib/sass/tree/if_node.rb +13 -0
- data/lib/sass/tree/import_node.rb +26 -7
- data/lib/sass/tree/mixin_def_node.rb +18 -0
- data/lib/sass/tree/mixin_node.rb +16 -1
- data/lib/sass/tree/node.rb +98 -27
- data/lib/sass/tree/prop_node.rb +97 -20
- data/lib/sass/tree/root_node.rb +37 -0
- data/lib/sass/tree/rule_node.rb +88 -60
- data/lib/sass/tree/variable_node.rb +9 -5
- data/lib/sass/tree/while_node.rb +4 -0
- data/test/haml/results/filters.xhtml +1 -1
- data/test/haml/util_test.rb +28 -0
- data/test/sass/conversion_test.rb +884 -0
- data/test/sass/css2sass_test.rb +46 -21
- data/test/sass/engine_test.rb +680 -160
- data/test/sass/functions_test.rb +27 -0
- data/test/sass/more_results/more_import.css +1 -1
- data/test/sass/more_templates/more_import.sass +3 -3
- data/test/sass/plugin_test.rb +28 -8
- data/test/sass/results/compact.css +1 -1
- data/test/sass/results/complex.css +5 -5
- data/test/sass/results/compressed.css +1 -1
- data/test/sass/results/expanded.css +1 -1
- data/test/sass/results/import.css +3 -1
- data/test/sass/results/mixins.css +12 -12
- data/test/sass/results/nested.css +1 -1
- data/test/sass/results/parent_ref.css +4 -4
- data/test/sass/results/script.css +3 -3
- data/test/sass/results/scss_import.css +15 -0
- data/test/sass/results/scss_importee.css +2 -0
- data/test/sass/script_conversion_test.rb +153 -0
- data/test/sass/script_test.rb +44 -54
- data/test/sass/scss/css_test.rb +811 -0
- data/test/sass/scss/rx_test.rb +156 -0
- data/test/sass/scss/scss_test.rb +871 -0
- data/test/sass/scss/test_helper.rb +37 -0
- data/test/sass/templates/alt.sass +2 -2
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/import.sass +4 -4
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/line_numbers.sass +1 -1
- data/test/sass/templates/mixins.sass +2 -2
- data/test/sass/templates/nested_mixin_bork.sass +1 -1
- data/test/sass/templates/options.sass +1 -1
- data/test/sass/templates/parent_ref.sass +2 -2
- data/test/sass/templates/script.sass +69 -69
- data/test/sass/templates/scss_import.scss +10 -0
- data/test/sass/templates/scss_importee.scss +1 -0
- data/test/sass/templates/units.sass +10 -10
- data/test/test_helper.rb +4 -4
- metadata +27 -2
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../test_helper'
|
2
|
+
require 'sass/engine'
|
3
|
+
|
4
|
+
module ScssTestHelper
|
5
|
+
def assert_parses(scss)
|
6
|
+
assert_equal scss.rstrip, render(scss).rstrip
|
7
|
+
end
|
8
|
+
|
9
|
+
def assert_not_parses(expected, scss)
|
10
|
+
raise "Template must include <err> where an error is expected" unless scss.include?("<err>")
|
11
|
+
|
12
|
+
after, was = scss.split("<err>")
|
13
|
+
line = after.count("\n") + 1
|
14
|
+
|
15
|
+
after.gsub!(/\s*\n\s*$/, '')
|
16
|
+
after.gsub!(/.*\n/, '')
|
17
|
+
after = "..." + after[-15..-1] if after.size > 18
|
18
|
+
|
19
|
+
was.gsub!(/^\s*\n\s*/, '')
|
20
|
+
was.gsub!(/\n.*/, '')
|
21
|
+
was = was[0...15] + "..." if was.size > 18
|
22
|
+
|
23
|
+
to_render = scss.sub("<err>", "")
|
24
|
+
render(to_render)
|
25
|
+
assert(false, "Expected syntax error for:\n#{to_render}\n")
|
26
|
+
rescue Sass::SyntaxError => err
|
27
|
+
assert_equal("Invalid CSS after \"#{after}\": expected #{expected}, was \"#{was}\"",
|
28
|
+
err.message)
|
29
|
+
assert_equal line, err.sass_line
|
30
|
+
end
|
31
|
+
|
32
|
+
def render(scss, options = {})
|
33
|
+
options[:syntax] ||= :scss
|
34
|
+
munge_filename options
|
35
|
+
Sass::Engine.new(scss, options).render
|
36
|
+
end
|
37
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
bork
|
2
|
-
:bork
|
2
|
+
:bork $bork
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
1
|
+
$preconst: hello
|
2
2
|
|
3
3
|
=premixin
|
4
4
|
pre-mixin: here
|
5
5
|
|
6
|
-
@import importee.sass, basic.sass, basic.css, ../results/complex.css, partial.sass
|
6
|
+
@import importee.sass, scss_importee, basic.sass, basic.css, ../results/complex.css, partial.sass
|
7
7
|
|
8
8
|
nonimported
|
9
|
-
:myconst
|
10
|
-
:otherconst
|
9
|
+
:myconst $preconst
|
10
|
+
:otherconst $postconst
|
11
11
|
+postmixin
|
@@ -1,2 +1,2 @@
|
|
1
1
|
foo
|
2
|
-
style
|
2
|
+
style: option("style")
|
@@ -15,9 +15,9 @@ p, div
|
|
15
15
|
:style solid
|
16
16
|
:width 2em
|
17
17
|
.ie7 &, .ie6 &
|
18
|
-
:content string(Totally not cool.)
|
18
|
+
:content string("Totally not cool.")
|
19
19
|
.firefox &
|
20
|
-
:content string(Quite cool.)
|
20
|
+
:content string("Quite cool.")
|
21
21
|
|
22
22
|
.wow, .snazzy
|
23
23
|
:font-family fantasy
|
@@ -1,101 +1,101 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
$width: 10em + 20
|
2
|
+
$color: #00ff98
|
3
|
+
$main_text: #ffa
|
4
|
+
$num: 10
|
5
|
+
$dec: 10.2
|
6
|
+
$dec_0: 99.0
|
7
|
+
$neg: -10
|
8
|
+
$esc: 10\+12
|
9
|
+
$str: Hello\!
|
10
|
+
$qstr: "Quo\"ted\"!"
|
11
|
+
$hstr: Hyph-en\!
|
12
|
+
$concat: #{5 + 4} hi there
|
13
|
+
$percent: 11%
|
14
|
+
$complex: 1px/1em
|
15
15
|
|
16
16
|
#main
|
17
|
-
:content
|
18
|
-
:qstr
|
19
|
-
:hstr
|
20
|
-
:width
|
17
|
+
:content $str
|
18
|
+
:qstr $qstr
|
19
|
+
:hstr $hstr
|
20
|
+
:width $width
|
21
21
|
:background-color #000
|
22
|
-
:color
|
23
|
-
:short-color
|
24
|
-
:named-color
|
25
|
-
:con
|
26
|
-
:con2
|
22
|
+
:color $main_text
|
23
|
+
:short-color #123
|
24
|
+
:named-color olive
|
25
|
+
:con "foo" bar ($concat "boom")
|
26
|
+
:con2 "noquo" quo
|
27
27
|
#sidebar
|
28
|
-
:background-color
|
28
|
+
:background-color $color
|
29
29
|
:num
|
30
|
-
:normal
|
31
|
-
:dec
|
32
|
-
:dec0
|
33
|
-
:neg
|
34
|
-
:esc
|
35
|
-
:many
|
36
|
-
:order
|
37
|
-
:complex
|
30
|
+
:normal $num
|
31
|
+
:dec $dec
|
32
|
+
:dec0 $dec_0
|
33
|
+
:neg $neg
|
34
|
+
:esc $esc
|
35
|
+
:many 1 + 2 + 3
|
36
|
+
:order 1 + 2 * 3
|
37
|
+
:complex ((1 + 2) + 15)+#3a8b9f + (hi+(1 +1+ 2)* 4)
|
38
38
|
|
39
39
|
#plus
|
40
40
|
:num
|
41
|
-
:num
|
42
|
-
:num-un
|
43
|
-
:num-un2
|
44
|
-
:num-neg
|
45
|
-
:str
|
46
|
-
:col
|
47
|
-
:perc
|
41
|
+
:num 5+2
|
42
|
+
:num-un 10em + 15em
|
43
|
+
:num-un2 10 + 13em
|
44
|
+
:num-neg 10 + -.13
|
45
|
+
:str 100 * 1px
|
46
|
+
:col 13 + #aaa
|
47
|
+
:perc $percent + 20%
|
48
48
|
:str
|
49
|
-
:str
|
50
|
-
:str2
|
51
|
-
:col
|
52
|
-
:num
|
49
|
+
:str "hi" + "\ there"
|
50
|
+
:str2 "hi" + " there"
|
51
|
+
:col "14em solid " + #123
|
52
|
+
:num "times: " + 13
|
53
53
|
:col
|
54
|
-
:num
|
55
|
-
:col
|
54
|
+
:num #f02 + 123.5
|
55
|
+
:col #12A + #405162
|
56
56
|
|
57
57
|
#minus
|
58
58
|
:num
|
59
|
-
:num
|
59
|
+
:num 912 - 12
|
60
60
|
:col
|
61
|
-
:num
|
62
|
-
:col
|
61
|
+
:num #fffffa - 5.2
|
62
|
+
:col #abcdef - #fedcba
|
63
63
|
:unary
|
64
|
-
:num
|
65
|
-
:const
|
66
|
-
:paren
|
67
|
-
:two
|
68
|
-
:many
|
69
|
-
:crazy
|
64
|
+
:num -1
|
65
|
+
:const -$neg
|
66
|
+
:paren -(5 + 6)
|
67
|
+
:two --12
|
68
|
+
:many --------12
|
69
|
+
:crazy -----(5 + ---$neg)
|
70
70
|
|
71
71
|
#times
|
72
72
|
:num
|
73
|
-
:num
|
74
|
-
:col
|
73
|
+
:num 2 * 3.5
|
74
|
+
:col 2 * #3a4b5c
|
75
75
|
:col
|
76
|
-
:num
|
77
|
-
:col
|
76
|
+
:num #12468a * 0.5
|
77
|
+
:col #121212 * #020304
|
78
78
|
|
79
79
|
#div
|
80
80
|
:num
|
81
|
-
:num
|
82
|
-
:num2
|
81
|
+
:num (10 / 3.0)
|
82
|
+
:num2 (10 / 3)
|
83
83
|
:col
|
84
|
-
:num
|
85
|
-
:col
|
86
|
-
:comp
|
84
|
+
:num #12468a / 2
|
85
|
+
:col #abcdef / #0f0f0f
|
86
|
+
:comp $complex * 1em
|
87
87
|
|
88
88
|
#mod
|
89
89
|
:num
|
90
|
-
:num
|
90
|
+
:num 17 % 3
|
91
91
|
:col
|
92
|
-
:col
|
93
|
-
:num
|
92
|
+
:col #5f6e7d % #10200a
|
93
|
+
:num #aaabac % 3
|
94
94
|
|
95
95
|
#const
|
96
96
|
:escaped
|
97
|
-
:quote
|
98
|
-
:default
|
97
|
+
:quote \$foo \!bar
|
98
|
+
:default $str !important
|
99
99
|
|
100
100
|
#regression
|
101
|
-
:a
|
101
|
+
:a (3 + 2) - 1
|
@@ -0,0 +1 @@
|
|
1
|
+
scss {imported: yes}
|
@@ -1,11 +1,11 @@
|
|
1
1
|
b
|
2
|
-
:foo
|
3
|
-
:bar
|
4
|
-
:baz
|
5
|
-
:many-units
|
6
|
-
:mm
|
7
|
-
:pc
|
8
|
-
:pt
|
9
|
-
:inches
|
10
|
-
:more-inches
|
11
|
-
:mixed
|
2
|
+
:foo 0.5 * 10px
|
3
|
+
:bar 10zzz * 12px / 5zzz
|
4
|
+
:baz percentage(12.0px / 18px)
|
5
|
+
:many-units 10.0zzz / 3yyy * 12px / 5zzz * 3yyy / 3px * 4em
|
6
|
+
:mm 5mm + 1cm
|
7
|
+
:pc 1pc + 12pt
|
8
|
+
:pt 72pt - 2in
|
9
|
+
:inches 1in + 2.54cm
|
10
|
+
:more-inches 1in + ((72pt * 2in) + (36pt * 1in)) / 2.54cm
|
11
|
+
:mixed (1 + (1em * 6px / 3in)) * 4in / 2em
|
data/test/test_helper.rb
CHANGED
@@ -19,18 +19,18 @@ module Sass::Script::Functions
|
|
19
19
|
end
|
20
20
|
|
21
21
|
class Test::Unit::TestCase
|
22
|
-
def munge_filename(opts)
|
22
|
+
def munge_filename(opts = {})
|
23
23
|
return if opts.has_key?(:filename)
|
24
|
-
opts[:filename] = filename_for_test
|
24
|
+
opts[:filename] = filename_for_test(opts[:syntax] || :sass)
|
25
25
|
end
|
26
26
|
|
27
|
-
def filename_for_test
|
27
|
+
def filename_for_test(syntax = :sass)
|
28
28
|
test_name = caller.
|
29
29
|
map {|c| Haml::Util.caller_info(c)[2]}.
|
30
30
|
compact.
|
31
31
|
map {|c| c.sub(/^(block|rescue) in /, '')}.
|
32
32
|
find {|c| c =~ /^test_/}
|
33
|
-
"#{test_name}_inline
|
33
|
+
"#{test_name}_inline.#{syntax}"
|
34
34
|
end
|
35
35
|
|
36
36
|
def clean_up_sassc
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.180
|
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: 2010-03-
|
13
|
+
date: 2010-03-31 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -99,6 +99,9 @@ files:
|
|
99
99
|
- lib/sass/script/string.rb
|
100
100
|
- lib/sass/script/unary_operation.rb
|
101
101
|
- lib/sass/script/variable.rb
|
102
|
+
- lib/sass/script/css_lexer.rb
|
103
|
+
- lib/sass/script/css_parser.rb
|
104
|
+
- lib/sass/script/interpolation.rb
|
102
105
|
- lib/sass/tree/comment_node.rb
|
103
106
|
- lib/sass/tree/debug_node.rb
|
104
107
|
- lib/sass/tree/directive_node.rb
|
@@ -113,6 +116,12 @@ files:
|
|
113
116
|
- lib/sass/tree/root_node.rb
|
114
117
|
- lib/sass/tree/variable_node.rb
|
115
118
|
- lib/sass/tree/while_node.rb
|
119
|
+
- lib/sass/scss.rb
|
120
|
+
- lib/sass/scss/css_parser.rb
|
121
|
+
- lib/sass/scss/parser.rb
|
122
|
+
- lib/sass/scss/rx.rb
|
123
|
+
- lib/sass/scss/script_lexer.rb
|
124
|
+
- lib/sass/scss/script_parser.rb
|
116
125
|
- vendor/fssm/LICENSE
|
117
126
|
- vendor/fssm/README.markdown
|
118
127
|
- vendor/fssm/Rakefile
|
@@ -147,6 +156,7 @@ files:
|
|
147
156
|
- bin/haml
|
148
157
|
- bin/html2haml
|
149
158
|
- bin/sass
|
159
|
+
- bin/sass-convert
|
150
160
|
- test/benchmark.rb
|
151
161
|
- test/haml/engine_test.rb
|
152
162
|
- test/haml/helper_test.rb
|
@@ -244,6 +254,12 @@ files:
|
|
244
254
|
- test/sass/results/subdir/nested_subdir/nested_subdir.css
|
245
255
|
- test/sass/results/subdir/subdir.css
|
246
256
|
- test/sass/results/units.css
|
257
|
+
- test/sass/results/scss_import.css
|
258
|
+
- test/sass/results/scss_importee.css
|
259
|
+
- test/sass/scss/css_test.rb
|
260
|
+
- test/sass/scss/rx_test.rb
|
261
|
+
- test/sass/scss/scss_test.rb
|
262
|
+
- test/sass/scss/test_helper.rb
|
247
263
|
- test/sass/templates/_partial.sass
|
248
264
|
- test/sass/templates/alt.sass
|
249
265
|
- test/sass/templates/basic.sass
|
@@ -274,7 +290,11 @@ files:
|
|
274
290
|
- test/sass/templates/subdir/nested_subdir/nested_subdir.sass
|
275
291
|
- test/sass/templates/subdir/subdir.sass
|
276
292
|
- test/sass/templates/units.sass
|
293
|
+
- test/sass/templates/scss_import.scss
|
294
|
+
- test/sass/templates/scss_importee.scss
|
277
295
|
- test/sass/callbacks_test.rb
|
296
|
+
- test/sass/conversion_test.rb
|
297
|
+
- test/sass/script_conversion_test.rb
|
278
298
|
- test/test_helper.rb
|
279
299
|
- extra/haml-mode.el
|
280
300
|
- extra/sass-mode.el
|
@@ -337,4 +357,9 @@ test_files:
|
|
337
357
|
- test/sass/functions_test.rb
|
338
358
|
- test/sass/plugin_test.rb
|
339
359
|
- test/sass/script_test.rb
|
360
|
+
- test/sass/scss/css_test.rb
|
361
|
+
- test/sass/scss/rx_test.rb
|
362
|
+
- test/sass/scss/scss_test.rb
|
340
363
|
- test/sass/callbacks_test.rb
|
364
|
+
- test/sass/conversion_test.rb
|
365
|
+
- test/sass/script_conversion_test.rb
|