haml-edge 2.3.238 → 2.3.239

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.238
1
+ 2.3.239
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.238
1
+ 2.3.239
@@ -51,5 +51,17 @@ module Sass::Tree
51
51
  end
52
52
  children
53
53
  end
54
+
55
+ # Returns an error message if the given child node is invalid,
56
+ # and false otherwise.
57
+ #
58
+ # {ExtendNode}s are valid within {ForNode}s.
59
+ #
60
+ # @param child [Tree::Node] A potential child node.
61
+ # @return [Boolean, String] Whether or not the child node is valid,
62
+ # as well as the error message to display if it is invalid
63
+ def invalid_child?(child)
64
+ super unless child.is_a?(ExtendNode)
65
+ end
54
66
  end
55
67
  end
@@ -65,5 +65,17 @@ module Sass::Tree
65
65
  return @else.perform(environment) if @else
66
66
  []
67
67
  end
68
+
69
+ # Returns an error message if the given child node is invalid,
70
+ # and false otherwise.
71
+ #
72
+ # {ExtendNode}s are valid within {IfNode}s.
73
+ #
74
+ # @param child [Tree::Node] A potential child node.
75
+ # @return [Boolean, String] Whether or not the child node is valid,
76
+ # as well as the error message to display if it is invalid
77
+ def invalid_child?(child)
78
+ super unless child.is_a?(ExtendNode)
79
+ end
68
80
  end
69
81
  end
@@ -68,7 +68,8 @@ module Sass
68
68
  child.send("to_#{fmt}", 0, opts) +
69
69
  if nxt &&
70
70
  (child.is_a?(CommentNode) && child.line + child.value.count("\n") + 1 == nxt.line) ||
71
- (child.is_a?(ImportNode) && nxt.is_a?(ImportNode) && child.line + 1 == nxt.line)
71
+ (child.is_a?(ImportNode) && nxt.is_a?(ImportNode) && child.line + 1 == nxt.line) ||
72
+ (child.is_a?(VariableNode) && nxt.is_a?(VariableNode) && child.line + 1 == nxt.line)
72
73
  ""
73
74
  else
74
75
  "\n"
@@ -32,5 +32,17 @@ module Sass::Tree
32
32
  end
33
33
  children
34
34
  end
35
+
36
+ # Returns an error message if the given child node is invalid,
37
+ # and false otherwise.
38
+ #
39
+ # {ExtendNode}s are valid within {WhileNode}s.
40
+ #
41
+ # @param child [Tree::Node] A potential child node.
42
+ # @return [Boolean, String] Whether or not the child node is valid,
43
+ # as well as the error message to display if it is invalid
44
+ def invalid_child?(child)
45
+ super unless child.is_a?(ExtendNode)
46
+ end
35
47
  end
36
48
  end
@@ -888,6 +888,24 @@ SCSS
888
888
  assert_sass_to_scss '$var: 12px $bar baz !default;', '$var ||= 12px $bar "baz"'
889
889
  end
890
890
 
891
+ def test_multiple_variable_definitions
892
+ assert_renders <<SASS, <<SCSS
893
+ $var1: foo
894
+ $var2: bar
895
+ $var3: baz
896
+
897
+ $var4: bip
898
+ $var5: bap
899
+ SASS
900
+ $var1: foo;
901
+ $var2: bar;
902
+ $var3: baz;
903
+
904
+ $var4: bip;
905
+ $var5: bap;
906
+ SCSS
907
+ end
908
+
891
909
  def test_division_asserted_with_parens
892
910
  assert_renders <<SASS, <<SCSS
893
911
  foo
@@ -1165,6 +1165,73 @@ a.bar.baz {a: b}
1165
1165
  SCSS
1166
1166
  end
1167
1167
 
1168
+ def test_control_flow_if
1169
+ assert_equal <<CSS, render(<<SCSS)
1170
+ .true, .also-true {
1171
+ color: green; }
1172
+
1173
+ .false, .also-false {
1174
+ color: red; }
1175
+ CSS
1176
+ .true { color: green; }
1177
+ .false { color: red; }
1178
+ .also-true {
1179
+ @if true { @extend .true; }
1180
+ @else { @extend .false; }
1181
+ }
1182
+ .also-false {
1183
+ @if false { @extend .true; }
1184
+ @else { @extend .false; }
1185
+ }
1186
+ SCSS
1187
+ end
1188
+
1189
+ def test_control_flow_for
1190
+ assert_equal <<CSS, render(<<SCSS)
1191
+ .base-0, .added {
1192
+ color: green; }
1193
+
1194
+ .base-1, .added {
1195
+ display: block; }
1196
+
1197
+ .base-2, .added {
1198
+ border: 1px solid blue; }
1199
+ CSS
1200
+ .base-0 { color: green; }
1201
+ .base-1 { display: block; }
1202
+ .base-2 { border: 1px solid blue; }
1203
+ .added {
1204
+ @for $i from 0 to 3 {
1205
+ @extend .base-\#{$i};
1206
+ }
1207
+ }
1208
+ SCSS
1209
+ end
1210
+
1211
+ def test_control_flow_while
1212
+ assert_equal <<CSS, render(<<SCSS)
1213
+ .base-0, .added {
1214
+ color: green; }
1215
+
1216
+ .base-1, .added {
1217
+ display: block; }
1218
+
1219
+ .base-2, .added {
1220
+ border: 1px solid blue; }
1221
+ CSS
1222
+ .base-0 { color: green; }
1223
+ .base-1 { display: block; }
1224
+ .base-2 { border: 1px solid blue; }
1225
+ .added {
1226
+ $i : 0;
1227
+ @while $i < 3 {
1228
+ @extend .base-\#{$i};
1229
+ $i : $i + 1;
1230
+ }
1231
+ }
1232
+ SCSS
1233
+ end
1234
+
1168
1235
  private
1169
1236
 
1170
1237
  def render(sass, options = {})
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.238
4
+ version: 2.3.239
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-05-01 00:00:00 -04:00
13
+ date: 2010-05-03 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency