sass 3.4.17 → 3.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a2ccebe7fb753327da211ef330b7544a13a46a9
4
- data.tar.gz: 6eba53fa8eb3e220d5186cce58ac9a1bdf5bfab3
3
+ metadata.gz: bd8b86fbb1af2645a7d82f27de07d7f39e5f36de
4
+ data.tar.gz: 49afe949dd2d70186bd8b855a770d83ade01cf4f
5
5
  SHA512:
6
- metadata.gz: 977690d0a4056b464ced8677e2ae5d6e55b8c806fb5428371a92f6ad5bd20ba331124aed8eb49a87b0f4d41cdf0993b1eb24a8b24062b7f5384d45e2725fa4b6
7
- data.tar.gz: 8ae528e829b69e0b2f6e361767e4dd8c0e4c7c788d735d69982664186d217055cd12386362563dda41db89cf5fecbcd2be5a467a1e90871c8d9e6f8332ce294b
6
+ metadata.gz: 3c97e8192675375f9adff2b79a79bdd322382689af2ab5f2192682e7c17eccffb173d9ef36cc0ca85fbd527a96f35c59d74e0ff2e4f2b31f90deeacc21951068
7
+ data.tar.gz: a37bb1312824bcf8c46543b31066b12aa0cd87c44d8970da5390eeb172d55a04df66d9db26d26c4156071c5afb393f6d117154f3107a6fc63f943557db93495a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.17
1
+ 3.4.18
@@ -1 +1 @@
1
- 22 August 2015 00:33:15 UTC
1
+ 25 August 2015 20:10:56 UTC
@@ -51,6 +51,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
51
51
  @source_mapping.add(source_range, target_range)
52
52
  end
53
53
 
54
+ def ends_with?(str)
55
+ @result.end_with?(str)
56
+ end
57
+
54
58
  # Move the output cursor back `chars` characters.
55
59
  def erase!(chars)
56
60
  return if chars == 0
@@ -124,6 +128,9 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
124
128
  end
125
129
  end
126
130
  rstrip!
131
+ if node.style == :compressed && ends_with?(";")
132
+ erase! 1
133
+ end
127
134
  return "" if @result.empty?
128
135
 
129
136
  output "\n"
@@ -171,10 +178,10 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
171
178
  if !node.has_children || node.children.empty?
172
179
  output(tab_str)
173
180
  for_node(node) {output(node.resolved_value)}
174
- if node.style == :compressed
175
- output("{}") if node.has_children
176
- else
177
- output(node.has_children ? " {}" : ";")
181
+ if node.has_children
182
+ output("#{' ' unless node.style == :compressed}{}")
183
+ elsif node.children.empty?
184
+ output(";")
178
185
  end
179
186
  return
180
187
  end
@@ -213,7 +220,9 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
213
220
  had_children = child.has_children
214
221
  first = false
215
222
  elsif node.style == :compressed
216
- output(had_children ? "" : ";")
223
+ unless had_children
224
+ output(";") unless ends_with?(";")
225
+ end
217
226
  with_tabs(0) {visit(child)}
218
227
  had_children = child.has_children
219
228
  else
@@ -222,6 +231,9 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
222
231
  end
223
232
  end
224
233
  rstrip!
234
+ if node.style == :compressed && ends_with?(";")
235
+ erase! 1
236
+ end
225
237
  if node.style == :expanded
226
238
  output("\n#{tab_str}")
227
239
  elsif node.style != :compressed
@@ -342,10 +354,18 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
342
354
 
343
355
  with_tabs(tabs) do
344
356
  node.children.each_with_index do |child, i|
345
- output(separator) if i > 0
357
+ if i > 0
358
+ if separator.start_with?(";") && ends_with?(";")
359
+ erase! 1
360
+ end
361
+ output(separator)
362
+ end
346
363
  visit(child)
347
364
  end
348
365
  end
366
+ if node.style == :compressed && ends_with?(";")
367
+ erase! 1
368
+ end
349
369
 
350
370
  output(end_props)
351
371
  output("}" + trailer)
@@ -3313,6 +3313,16 @@ CSS
3313
3313
  SASS
3314
3314
  end
3315
3315
 
3316
+ def test_import_two_css_files_issue_1806
3317
+ assert_equal(<<CSS, render(<<SASS, :syntax => :scss, :style => :compressed))
3318
+ @import url(\"foo.css\");@import url(\"bar.css\");@import url(\"baz.css\")
3319
+ CSS
3320
+ @import url("foo.css");
3321
+ @import url("bar.css");
3322
+ @import url("baz.css");
3323
+ SASS
3324
+ end
3325
+
3316
3326
  private
3317
3327
 
3318
3328
  def assert_hash_has(hash, expected)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.17
4
+ version: 3.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-08-22 00:00:00.000000000 Z
13
+ date: 2015-08-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yard