sass 3.3.7 → 3.3.8
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 +4 -4
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/engine.rb +8 -7
- data/lib/sass/plugin/compiler.rb +4 -40
- data/lib/sass/script/functions.rb +33 -26
- data/lib/sass/scss/parser.rb +4 -4
- data/lib/sass/selector/comma_sequence.rb +1 -2
- data/lib/sass/selector/sequence.rb +3 -1
- data/lib/sass/tree/visitors/convert.rb +3 -2
- data/lib/sass/tree/visitors/cssize.rb +17 -5
- data/lib/sass/tree/visitors/perform.rb +1 -1
- data/lib/sass/util.rb +75 -0
- data/test/sass/compiler_test.rb +4 -4
- data/test/sass/css2sass_test.rb +19 -0
- data/test/sass/scss/scss_test.rb +38 -0
- data/test/sass/util_test.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bf6310b2324741eab4f6267b1999e90b522b0d7
|
4
|
+
data.tar.gz: df120388678de1053e5f8a22d1b4e972d0ab536c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2138eb4290f33ed4058020bdf52e238802a11b5be8d2ad1eed798691005cf6ce02f765cbd6db48ee90e5b7b23c1c6825db0e4711ebc69e9ee9e5dbe788c75879
|
7
|
+
data.tar.gz: 81538da0a25f9c024f7bfd20bbc38e53873c8f2f72b4f822dc950d04f8990274a8cb37483fa1603bf101941bb022244a455c84e496fb152a46d427b03959660f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.8
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
31 May 2014 00:35:27 UTC
|
data/lib/sass/engine.rb
CHANGED
@@ -1009,15 +1009,16 @@ WARNING
|
|
1009
1009
|
script_parser = Sass::Script::Parser.new(scanner, @line, to_parser_offset(offset), @options)
|
1010
1010
|
str = script_parser.parse_string
|
1011
1011
|
|
1012
|
-
|
1013
|
-
@options[:filename], @options[:importer],
|
1014
|
-
@line, str.source_range.end_pos.offset)
|
1015
|
-
if (media = media_parser.parse_media_query_list)
|
1016
|
-
end_pos = Sass::Source::Position.new(@line, media_parser.offset + 1)
|
1017
|
-
node = Tree::CssImportNode.new(str, media.to_a)
|
1018
|
-
else
|
1012
|
+
if scanner.eos?
|
1019
1013
|
end_pos = str.source_range.end_pos
|
1020
1014
|
node = Tree::CssImportNode.new(str)
|
1015
|
+
else
|
1016
|
+
media_parser = Sass::SCSS::Parser.new(scanner,
|
1017
|
+
@options[:filename], @options[:importer],
|
1018
|
+
@line, str.source_range.end_pos.offset)
|
1019
|
+
media = media_parser.parse_media_query_list
|
1020
|
+
end_pos = Sass::Source::Position.new(@line, media_parser.offset + 1)
|
1021
|
+
node = Tree::CssImportNode.new(str, media.to_a)
|
1021
1022
|
end
|
1022
1023
|
|
1023
1024
|
node.source_range = Sass::Source::Range.new(
|
data/lib/sass/plugin/compiler.rb
CHANGED
@@ -229,7 +229,9 @@ module Sass::Plugin
|
|
229
229
|
# A Listen version prior to 2.0 will write a test file to a directory to
|
230
230
|
# see if a watcher supports watching that directory. That breaks horribly
|
231
231
|
# on read-only directories, so we filter those out.
|
232
|
-
|
232
|
+
unless Sass::Util.listen_geq_2?
|
233
|
+
directories = directories.select {|d| File.directory?(d) && File.writable?(d)}
|
234
|
+
end
|
233
235
|
|
234
236
|
# TODO: Keep better track of what depends on what
|
235
237
|
# so we don't have to run a global update every time anything changes.
|
@@ -276,7 +278,7 @@ module Sass::Plugin
|
|
276
278
|
private
|
277
279
|
|
278
280
|
def create_listener(*args, &block)
|
279
|
-
load_listen!
|
281
|
+
Sass::Util.load_listen!
|
280
282
|
if Sass::Util.listen_geq_2?
|
281
283
|
Listen.to(*args, &block)
|
282
284
|
else
|
@@ -310,44 +312,6 @@ module Sass::Plugin
|
|
310
312
|
dedupped
|
311
313
|
end
|
312
314
|
|
313
|
-
def load_listen!
|
314
|
-
if defined?(gem)
|
315
|
-
begin
|
316
|
-
gem 'listen', '>= 1.1.0', '< 3.0.0'
|
317
|
-
require 'listen'
|
318
|
-
rescue Gem::LoadError
|
319
|
-
dir = Sass::Util.scope("vendor/listen/lib")
|
320
|
-
$LOAD_PATH.unshift dir
|
321
|
-
begin
|
322
|
-
require 'listen'
|
323
|
-
rescue LoadError => e
|
324
|
-
if Sass::Util.version_geq(RUBY_VERSION, "1.9.3")
|
325
|
-
version_constraint = "~> 2.7"
|
326
|
-
else
|
327
|
-
version_constraint = "~> 1.1"
|
328
|
-
end
|
329
|
-
e.message << "\n" <<
|
330
|
-
"Run \"gem install listen --version '#{version_constraint}'\" to get it."
|
331
|
-
raise e
|
332
|
-
end
|
333
|
-
end
|
334
|
-
else
|
335
|
-
begin
|
336
|
-
require 'listen'
|
337
|
-
rescue LoadError => e
|
338
|
-
dir = Sass::Util.scope("vendor/listen/lib")
|
339
|
-
if $LOAD_PATH.include?(dir)
|
340
|
-
raise e unless File.exists?(scope(".git"))
|
341
|
-
e.message << "\n" <<
|
342
|
-
'Run "git submodule update --init" to get the bundled version.'
|
343
|
-
else
|
344
|
-
$LOAD_PATH.unshift dir
|
345
|
-
retry
|
346
|
-
end
|
347
|
-
end
|
348
|
-
end
|
349
|
-
end
|
350
|
-
|
351
315
|
def on_file_changed(individual_files, modified, added, removed)
|
352
316
|
recompile_required = false
|
353
317
|
|
@@ -2036,7 +2036,7 @@ module Sass::Script
|
|
2036
2036
|
# @raise [ArgumentError] if `$args` isn't a variable argument list
|
2037
2037
|
def keywords(args)
|
2038
2038
|
assert_type args, :ArgList, :args
|
2039
|
-
map(Sass::Util.map_keys(args.keywords.as_stored) {|k| Sass::Script::String.new(k)})
|
2039
|
+
map(Sass::Util.map_keys(args.keywords.as_stored) {|k| Sass::Script::Value::String.new(k)})
|
2040
2040
|
end
|
2041
2041
|
declare :keywords, [:args]
|
2042
2042
|
|
@@ -2106,31 +2106,29 @@ module Sass::Script
|
|
2106
2106
|
end
|
2107
2107
|
declare :call, [:name], :var_args => true, :var_kwargs => true
|
2108
2108
|
|
2109
|
-
# This function only exists as a workaround for IE7's [`content:
|
2110
|
-
# bug]
|
2109
|
+
# This function only exists as a workaround for IE7's [`content:
|
2110
|
+
# counter` bug](http://jes.st/2013/ie7s-css-breaking-content-counter-bug/).
|
2111
|
+
# It works identically to any other plain-CSS function, except it
|
2111
2112
|
# avoids adding spaces between the argument commas.
|
2112
2113
|
#
|
2113
|
-
# [bug]: http://jes.st/2013/ie7s-css-breaking-content-counter-bug/
|
2114
|
-
#
|
2115
2114
|
# @example
|
2116
2115
|
# counter(item, ".") => counter(item,".")
|
2117
2116
|
# @overload counter($args...)
|
2118
|
-
# @return [String]
|
2117
|
+
# @return [Sass::Script::Value::String]
|
2119
2118
|
def counter(*args)
|
2120
2119
|
identifier("counter(#{args.map {|a| a.to_s(options)}.join(',')})")
|
2121
2120
|
end
|
2122
2121
|
declare :counter, [], :var_args => true
|
2123
2122
|
|
2124
|
-
# This function only exists as a workaround for IE7's [`content:
|
2125
|
-
# bug]
|
2123
|
+
# This function only exists as a workaround for IE7's [`content:
|
2124
|
+
# counter` bug](http://jes.st/2013/ie7s-css-breaking-content-counter-bug/).
|
2125
|
+
# It works identically to any other plain-CSS function, except it
|
2126
2126
|
# avoids adding spaces between the argument commas.
|
2127
2127
|
#
|
2128
|
-
# [bug]: http://jes.st/2013/ie7s-css-breaking-content-counter-bug/
|
2129
|
-
#
|
2130
2128
|
# @example
|
2131
2129
|
# counters(item, ".") => counters(item,".")
|
2132
2130
|
# @overload counters($args...)
|
2133
|
-
# @return [String]
|
2131
|
+
# @return [Sass::Script::Value::String]
|
2134
2132
|
def counters(*args)
|
2135
2133
|
identifier("counters(#{args.map {|a| a.to_s(options)}.join(',')})")
|
2136
2134
|
end
|
@@ -2144,9 +2142,11 @@ module Sass::Script
|
|
2144
2142
|
# variable-exists(a-false-value) => true
|
2145
2143
|
#
|
2146
2144
|
# variable-exists(nonexistent) => false
|
2147
|
-
#
|
2148
|
-
#
|
2149
|
-
#
|
2145
|
+
#
|
2146
|
+
# @overload variable_exists($name)
|
2147
|
+
# @param $name [Sass::Script::Value::String] The name of the variable to
|
2148
|
+
# check. The name should not include the `$`.
|
2149
|
+
# @return [Sass::Script::Value::Bool] Whether the variable is defined in
|
2150
2150
|
# the current scope.
|
2151
2151
|
def variable_exists(name)
|
2152
2152
|
assert_type name, :String, :name
|
@@ -2165,9 +2165,11 @@ module Sass::Script
|
|
2165
2165
|
# $some-var: false;
|
2166
2166
|
# @if global-variable-exists(some-var) { /* false, doesn't run */ }
|
2167
2167
|
# }
|
2168
|
-
#
|
2169
|
-
#
|
2170
|
-
#
|
2168
|
+
#
|
2169
|
+
# @overload global_variable_exists($name)
|
2170
|
+
# @param $name [Sass::Script::Value::String] The name of the variable to
|
2171
|
+
# check. The name should not include the `$`.
|
2172
|
+
# @return [Sass::Script::Value::Bool] Whether the variable is defined in
|
2171
2173
|
# the global scope.
|
2172
2174
|
def global_variable_exists(name)
|
2173
2175
|
assert_type name, :String, :name
|
@@ -2182,9 +2184,11 @@ module Sass::Script
|
|
2182
2184
|
#
|
2183
2185
|
# @function myfunc { @return "something"; }
|
2184
2186
|
# function-exists(myfunc) => true
|
2185
|
-
#
|
2186
|
-
#
|
2187
|
-
#
|
2187
|
+
#
|
2188
|
+
# @overload function_exists($name)
|
2189
|
+
# @param name [Sass::Script::Value::String] The name of the function to
|
2190
|
+
# check.
|
2191
|
+
# @return [Sass::Script::Value::Bool] Whether the function is defined.
|
2188
2192
|
def function_exists(name)
|
2189
2193
|
assert_type name, :String, :name
|
2190
2194
|
exists = Sass::Script::Functions.callable?(name.value.tr("-", "_"))
|
@@ -2200,9 +2204,11 @@ module Sass::Script
|
|
2200
2204
|
#
|
2201
2205
|
# @mixin red-text { color: red; }
|
2202
2206
|
# mixin-exists(red-text) => true
|
2203
|
-
#
|
2204
|
-
#
|
2205
|
-
#
|
2207
|
+
#
|
2208
|
+
# @overload mixin_exists($name)
|
2209
|
+
# @param name [Sass::Script::Value::String] The name of the mixin to
|
2210
|
+
# check.
|
2211
|
+
# @return [Sass::Script::Value::Bool] Whether the mixin is defined.
|
2206
2212
|
def mixin_exists(name)
|
2207
2213
|
assert_type name, :String, :name
|
2208
2214
|
bool(environment.mixin(name.value))
|
@@ -2211,7 +2217,8 @@ module Sass::Script
|
|
2211
2217
|
|
2212
2218
|
# Return a string containing the value as its Sass representation.
|
2213
2219
|
#
|
2214
|
-
# @
|
2220
|
+
# @overload inspect($value)
|
2221
|
+
# @param $value [Sass::Script::Value::Base] The value to inspect.
|
2215
2222
|
# @return [Sass::Script::Value::String] A representation of the value as
|
2216
2223
|
# it would be written in Sass.
|
2217
2224
|
def inspect(value)
|
@@ -2221,12 +2228,12 @@ module Sass::Script
|
|
2221
2228
|
|
2222
2229
|
# @overload random()
|
2223
2230
|
# Return a decimal between 0 and 1, inclusive of 0 but not 1.
|
2224
|
-
# @return [Sass::Script::Number] A decimal value.
|
2231
|
+
# @return [Sass::Script::Value::Number] A decimal value.
|
2225
2232
|
# @overload random($limit)
|
2226
2233
|
# Return an integer between 1 and `$limit`, inclusive of 1 but not `$limit`.
|
2227
2234
|
# @param $limit [Sass::Script::Value::Number] The maximum of the random integer to be
|
2228
2235
|
# returned, a positive integer.
|
2229
|
-
# @return [Sass::Script::Number] An integer.
|
2236
|
+
# @return [Sass::Script::Value::Number] An integer.
|
2230
2237
|
# @raise [ArgumentError] if the `$limit` is not 1 or greater
|
2231
2238
|
def random(limit = nil)
|
2232
2239
|
generator = Sass::Script::Functions.random_number_generator
|
data/lib/sass/scss/parser.rb
CHANGED
@@ -39,7 +39,7 @@ module Sass
|
|
39
39
|
def parse
|
40
40
|
init_scanner!
|
41
41
|
root = stylesheet
|
42
|
-
expected("selector or at-rule") unless @scanner.eos?
|
42
|
+
expected("selector or at-rule") unless root && @scanner.eos?
|
43
43
|
root
|
44
44
|
end
|
45
45
|
|
@@ -62,7 +62,7 @@ module Sass
|
|
62
62
|
def parse_media_query_list
|
63
63
|
init_scanner!
|
64
64
|
ql = media_query_list
|
65
|
-
expected("media query list") unless @scanner.eos?
|
65
|
+
expected("media query list") unless ql && @scanner.eos?
|
66
66
|
ql
|
67
67
|
end
|
68
68
|
|
@@ -74,7 +74,7 @@ module Sass
|
|
74
74
|
def parse_at_root_query
|
75
75
|
init_scanner!
|
76
76
|
query = at_root_query
|
77
|
-
expected("@at-root query list") unless @scanner.eos?
|
77
|
+
expected("@at-root query list") unless query && @scanner.eos?
|
78
78
|
query
|
79
79
|
end
|
80
80
|
|
@@ -86,7 +86,7 @@ module Sass
|
|
86
86
|
def parse_supports_condition
|
87
87
|
init_scanner!
|
88
88
|
condition = supports_condition
|
89
|
-
expected("supports condition") unless @scanner.eos?
|
89
|
+
expected("supports condition") unless condition && @scanner.eos?
|
90
90
|
condition
|
91
91
|
end
|
92
92
|
|
@@ -119,7 +119,9 @@ module Sass
|
|
119
119
|
ary = @members.map do |seq_or_op|
|
120
120
|
seq_or_op.is_a?(SimpleSequence) ? seq_or_op.to_a : seq_or_op
|
121
121
|
end
|
122
|
-
Sass::Util.intersperse(ary, " ").flatten.compact
|
122
|
+
ary = Sass::Util.intersperse(ary, " ").flatten.compact
|
123
|
+
ary = Sass::Util.replace_subseq(ary, ["\n", " "], ["\n"])
|
124
|
+
Sass::Util.replace_subseq(ary, [" ", "\n"], ["\n"])
|
123
125
|
end
|
124
126
|
|
125
127
|
# Returns a string representation of the sequence.
|
@@ -236,12 +236,13 @@ class Sass::Tree::Visitors::Convert < Sass::Tree::Visitors::Base
|
|
236
236
|
end
|
237
237
|
|
238
238
|
def visit_rule(node)
|
239
|
+
rule = node.parsed_rules ? node.parsed_rules.to_a : node.rule
|
239
240
|
if @format == :sass
|
240
|
-
name = selector_to_sass(
|
241
|
+
name = selector_to_sass(rule)
|
241
242
|
name = "\\" + name if name[0] == ?:
|
242
243
|
name.gsub(/^/, tab_str) + yield
|
243
244
|
elsif @format == :scss
|
244
|
-
name = selector_to_scss(
|
245
|
+
name = selector_to_scss(rule)
|
245
246
|
res = name + yield
|
246
247
|
if node.children.last.is_a?(Sass::Tree::CommentNode) && node.children.last.type == :silent
|
247
248
|
res.slice!(-3..-1)
|
@@ -315,19 +315,31 @@ class Sass::Tree::Visitors::Cssize < Sass::Tree::Visitors::Base
|
|
315
315
|
# omitted.
|
316
316
|
# @return [List<Sass::Tree::Node, Bubble>]
|
317
317
|
def debubble(children, parent = nil)
|
318
|
+
# Keep track of the previous parent so that we don't divide `parent`
|
319
|
+
# unnecessarily if the `@at-root` doesn't produce any new nodes (e.g.
|
320
|
+
# `@at-root {@extend %foo}`).
|
321
|
+
previous_parent = nil
|
322
|
+
|
318
323
|
Sass::Util.slice_by(children) {|c| c.is_a?(Bubble)}.map do |(is_bubble, slice)|
|
319
324
|
unless is_bubble
|
320
325
|
next slice unless parent
|
321
|
-
|
322
|
-
|
323
|
-
|
326
|
+
if previous_parent
|
327
|
+
previous_parent.children.push(*slice)
|
328
|
+
next []
|
329
|
+
else
|
330
|
+
previous_parent = new_parent = parent.dup
|
331
|
+
new_parent.children = slice
|
332
|
+
next new_parent
|
333
|
+
end
|
324
334
|
end
|
325
335
|
|
326
|
-
|
336
|
+
slice.map do |bubble|
|
327
337
|
next unless (node = block_given? ? yield(bubble.node) : bubble.node)
|
328
338
|
node.tabs += bubble.tabs
|
329
339
|
node.group_end = bubble.group_end
|
330
|
-
[visit(node)].flatten
|
340
|
+
results = [visit(node)].flatten
|
341
|
+
previous_parent = nil unless results.empty?
|
342
|
+
results
|
331
343
|
end.compact
|
332
344
|
end.flatten
|
333
345
|
end
|
@@ -487,7 +487,7 @@ WARNING
|
|
487
487
|
|
488
488
|
def visit_cssimport(node)
|
489
489
|
node.resolved_uri = run_interp([node.uri])
|
490
|
-
if node.query
|
490
|
+
if node.query && !node.query.empty?
|
491
491
|
parser = Sass::SCSS::StaticParser.new(run_interp(node.query),
|
492
492
|
node.filename, node.options[:importer], node.line)
|
493
493
|
node.resolved_query ||= parser.parse_media_query_list
|
data/lib/sass/util.rb
CHANGED
@@ -162,6 +162,43 @@ module Sass
|
|
162
162
|
end
|
163
163
|
end
|
164
164
|
|
165
|
+
# Non-destructively replaces all occurrences of a subsequence in an array
|
166
|
+
# with another subsequence.
|
167
|
+
#
|
168
|
+
# @example
|
169
|
+
# replace_subseq([1, 2, 3, 4, 5], [2, 3], [:a, :b])
|
170
|
+
# #=> [1, :a, :b, 4, 5]
|
171
|
+
#
|
172
|
+
# @param arr [Array] The array whose subsequences will be replaced.
|
173
|
+
# @param subseq [Array] The subsequence to find and replace.
|
174
|
+
# @param replacement [Array] The sequence that `subseq` will be replaced with.
|
175
|
+
# @return [Array] `arr` with `subseq` replaced with `replacement`.
|
176
|
+
def replace_subseq(arr, subseq, replacement)
|
177
|
+
new = []
|
178
|
+
matched = []
|
179
|
+
i = 0
|
180
|
+
arr.each do |elem|
|
181
|
+
if elem != subseq[i]
|
182
|
+
new.push(*matched)
|
183
|
+
matched = []
|
184
|
+
i = 0
|
185
|
+
new << elem
|
186
|
+
next
|
187
|
+
end
|
188
|
+
|
189
|
+
if i == subseq.length - 1
|
190
|
+
matched = []
|
191
|
+
i = 0
|
192
|
+
new.push(*replacement)
|
193
|
+
else
|
194
|
+
matched << elem
|
195
|
+
i += 1
|
196
|
+
end
|
197
|
+
end
|
198
|
+
new.push(*matched)
|
199
|
+
new
|
200
|
+
end
|
201
|
+
|
165
202
|
# Intersperses a value in an enumerable, as would be done with `Array#join`
|
166
203
|
# but without concatenating the array together afterwards.
|
167
204
|
#
|
@@ -1173,6 +1210,44 @@ MSG
|
|
1173
1210
|
tmpfile.unlink if tmpfile
|
1174
1211
|
end
|
1175
1212
|
|
1213
|
+
def load_listen!
|
1214
|
+
if defined?(gem)
|
1215
|
+
begin
|
1216
|
+
gem 'listen', '>= 1.1.0', '< 3.0.0'
|
1217
|
+
require 'listen'
|
1218
|
+
rescue Gem::LoadError
|
1219
|
+
dir = scope("vendor/listen/lib")
|
1220
|
+
$LOAD_PATH.unshift dir
|
1221
|
+
begin
|
1222
|
+
require 'listen'
|
1223
|
+
rescue LoadError => e
|
1224
|
+
if version_geq(RUBY_VERSION, "1.9.3")
|
1225
|
+
version_constraint = "~> 2.7"
|
1226
|
+
else
|
1227
|
+
version_constraint = "~> 1.1"
|
1228
|
+
end
|
1229
|
+
e.message << "\n" <<
|
1230
|
+
"Run \"gem install listen --version '#{version_constraint}'\" to get it."
|
1231
|
+
raise e
|
1232
|
+
end
|
1233
|
+
end
|
1234
|
+
else
|
1235
|
+
begin
|
1236
|
+
require 'listen'
|
1237
|
+
rescue LoadError => e
|
1238
|
+
dir = scope("vendor/listen/lib")
|
1239
|
+
if $LOAD_PATH.include?(dir)
|
1240
|
+
raise e unless File.exists?(scope(".git"))
|
1241
|
+
e.message << "\n" <<
|
1242
|
+
'Run "git submodule update --init" to get the bundled version.'
|
1243
|
+
else
|
1244
|
+
$LOAD_PATH.unshift dir
|
1245
|
+
retry
|
1246
|
+
end
|
1247
|
+
end
|
1248
|
+
end
|
1249
|
+
end
|
1250
|
+
|
1176
1251
|
private
|
1177
1252
|
|
1178
1253
|
# rubocop:disable LineLength
|
data/test/sass/compiler_test.rb
CHANGED
@@ -174,12 +174,12 @@ class CompilerTest < Test::Unit::TestCase
|
|
174
174
|
directories = nil
|
175
175
|
c = watcher do |listener|
|
176
176
|
directories = listener.directories
|
177
|
-
listener.removed "
|
177
|
+
listener.removed File.expand_path("./foo.scss")
|
178
178
|
listener.fire_events!
|
179
179
|
end
|
180
|
-
c.watch([["
|
181
|
-
assert directories.include?("
|
182
|
-
assert_equal "
|
180
|
+
c.watch([[File.expand_path("./foo.scss"), File.expand_path("./foo.css"), nil]])
|
181
|
+
assert directories.include?(File.expand_path(".")), directories.inspect
|
182
|
+
assert_equal File.expand_path("./foo.css"), c.deleted_css_files.first, "the corresponding css file was not deleted"
|
183
183
|
assert_equal [], c.update_stylesheets_called_with[1], "the sass file should not have been compiled"
|
184
184
|
end
|
185
185
|
|
data/test/sass/css2sass_test.rb
CHANGED
@@ -265,6 +265,25 @@ CSS
|
|
265
265
|
|
266
266
|
# Regressions
|
267
267
|
|
268
|
+
def test_nesting_with_matching_property
|
269
|
+
assert_equal(<<SASS, css2sass(<<CSS))
|
270
|
+
ul
|
271
|
+
width: 10px
|
272
|
+
div
|
273
|
+
width: 20px
|
274
|
+
|
275
|
+
article
|
276
|
+
width: 10px
|
277
|
+
p
|
278
|
+
width: 20px
|
279
|
+
SASS
|
280
|
+
ul {width: 10px}
|
281
|
+
ul div {width: 20px}
|
282
|
+
article {width: 10px}
|
283
|
+
article p {width: 20px}
|
284
|
+
CSS
|
285
|
+
end
|
286
|
+
|
268
287
|
def test_empty_rule
|
269
288
|
assert_equal(<<SASS, css2sass(<<CSS))
|
270
289
|
a
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -2848,6 +2848,34 @@ CSS
|
|
2848
2848
|
SCSS
|
2849
2849
|
end
|
2850
2850
|
|
2851
|
+
def test_at_root_doesnt_always_break_blocks
|
2852
|
+
assert_equal <<CSS, render(<<SCSS)
|
2853
|
+
.foo {
|
2854
|
+
a: b; }
|
2855
|
+
|
2856
|
+
@media screen {
|
2857
|
+
.foo {
|
2858
|
+
c: d; }
|
2859
|
+
.bar {
|
2860
|
+
e: f; } }
|
2861
|
+
CSS
|
2862
|
+
%base {
|
2863
|
+
a: b;
|
2864
|
+
}
|
2865
|
+
|
2866
|
+
@media screen {
|
2867
|
+
.foo {
|
2868
|
+
c: d;
|
2869
|
+
@at-root (without: media) {
|
2870
|
+
@extend %base;
|
2871
|
+
}
|
2872
|
+
}
|
2873
|
+
|
2874
|
+
.bar {e: f}
|
2875
|
+
}
|
2876
|
+
SCSS
|
2877
|
+
end
|
2878
|
+
|
2851
2879
|
## Errors
|
2852
2880
|
|
2853
2881
|
def test_nested_mixin_def_is_scoped
|
@@ -3098,6 +3126,16 @@ MESSAGE
|
|
3098
3126
|
SCSS
|
3099
3127
|
end
|
3100
3128
|
|
3129
|
+
def test_empty_media_query_error
|
3130
|
+
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render(<<SCSS)}
|
3131
|
+
Invalid CSS after "": expected media query list, was ""
|
3132
|
+
MESSAGE
|
3133
|
+
@media \#{""} {
|
3134
|
+
foo {a: b}
|
3135
|
+
}
|
3136
|
+
SCSS
|
3137
|
+
end
|
3138
|
+
|
3101
3139
|
# Regression
|
3102
3140
|
|
3103
3141
|
def test_top_level_unknown_directive_in_at_root
|
data/test/sass/util_test.rb
CHANGED
@@ -79,6 +79,15 @@ class UtilTest < Test::Unit::TestCase
|
|
79
79
|
merge_adjacent_strings([str, " ", str, " ", str, :bang, str, " ", str, 12]))
|
80
80
|
end
|
81
81
|
|
82
|
+
def test_replace_subseq
|
83
|
+
assert_equal([1, 2, :a, :b, 5],
|
84
|
+
replace_subseq([1, 2, 3, 4, 5], [3, 4], [:a, :b]))
|
85
|
+
assert_equal([1, 2, 3, 4, 5],
|
86
|
+
replace_subseq([1, 2, 3, 4, 5], [3, 4, 6], [:a, :b]))
|
87
|
+
assert_equal([1, 2, 3, 4, 5],
|
88
|
+
replace_subseq([1, 2, 3, 4, 5], [4, 5, 6], [:a, :b]))
|
89
|
+
end
|
90
|
+
|
82
91
|
def test_intersperse
|
83
92
|
assert_equal(["foo", " ", "bar", " ", "baz"],
|
84
93
|
intersperse(%w[foo bar baz], " "))
|
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.3.
|
4
|
+
version: 3.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-05-
|
13
|
+
date: 2014-05-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yard
|