sass 3.1.7 → 3.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sass/cache_stores/filesystem.rb +2 -0
- data/lib/sass/css.rb +2 -1
- data/lib/sass/engine.rb +9 -4
- data/lib/sass/exec.rb +14 -1
- data/lib/sass/importers/base.rb +2 -1
- data/lib/sass/script/number.rb +28 -5
- data/lib/sass/scss/parser.rb +39 -24
- data/lib/sass/scss/static_parser.rb +2 -2
- data/lib/sass/tree/rule_node.rb +2 -2
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/perform.rb +7 -5
- data/lib/sass/tree/visitors/set_options.rb +1 -1
- data/test/Gemfile +4 -0
- data/test/Gemfile.lock +19 -0
- data/test/sass/css2sass_test.rb +9 -0
- data/test/sass/engine_test.rb +28 -6
- data/test/sass/scss/css_test.rb +1 -1
- data/test/sass/scss/scss_test.rb +11 -13
- data/test/sass/templates/bork5.sass +3 -0
- data/test/sass/templates/nested_bork5.sass +2 -0
- metadata +14 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.8
|
data/lib/sass/css.rb
CHANGED
@@ -75,7 +75,7 @@ module Sass
|
|
75
75
|
#
|
76
76
|
# @return [Tree::Node] The root node of the parsed tree
|
77
77
|
def build_tree
|
78
|
-
root = Sass::SCSS::CssParser.new(@template).parse
|
78
|
+
root = Sass::SCSS::CssParser.new(@template, @options[:filename]).parse
|
79
79
|
expand_commas root
|
80
80
|
parent_ref_rules root
|
81
81
|
remove_parent_refs root
|
@@ -106,6 +106,7 @@ module Sass
|
|
106
106
|
next child
|
107
107
|
end
|
108
108
|
child.rule.first.split(',').map do |rule|
|
109
|
+
next if rule.strip.empty?
|
109
110
|
node = Tree::RuleNode.new([rule.strip])
|
110
111
|
node.children = child.children
|
111
112
|
node
|
data/lib/sass/engine.rb
CHANGED
@@ -317,7 +317,7 @@ module Sass
|
|
317
317
|
check_encoding!
|
318
318
|
|
319
319
|
if @options[:syntax] == :scss
|
320
|
-
root = Sass::SCSS::Parser.new(@template).parse
|
320
|
+
root = Sass::SCSS::Parser.new(@template, @options[:filename]).parse
|
321
321
|
else
|
322
322
|
root = Tree::RootNode.new(@template)
|
323
323
|
append_children(root, tree(tabulate(@template)).first, true)
|
@@ -559,7 +559,7 @@ WARNING
|
|
559
559
|
def parse_property_or_rule(line)
|
560
560
|
scanner = StringScanner.new(line.text)
|
561
561
|
hack_char = scanner.scan(/[:\*\.]|\#(?!\{)/)
|
562
|
-
parser = Sass::SCSS::SassParser.new(scanner, @line)
|
562
|
+
parser = Sass::SCSS::SassParser.new(scanner, @options[:filename], @line)
|
563
563
|
|
564
564
|
unless res = parser.parse_interp_ident
|
565
565
|
return Tree::RuleNode.new(parse_interp(line.text))
|
@@ -745,6 +745,11 @@ WARNING
|
|
745
745
|
break unless scanner.scan(/,\s*/)
|
746
746
|
end
|
747
747
|
|
748
|
+
if scanner.scan(/;/)
|
749
|
+
raise SyntaxError.new("Invalid @import: expected end of line, was \";\".",
|
750
|
+
:line => @line)
|
751
|
+
end
|
752
|
+
|
748
753
|
return values
|
749
754
|
end
|
750
755
|
|
@@ -752,12 +757,12 @@ WARNING
|
|
752
757
|
return if scanner.eos?
|
753
758
|
unless (str = scanner.scan(Sass::SCSS::RX::STRING)) ||
|
754
759
|
(uri = scanner.scan(Sass::SCSS::RX::URI))
|
755
|
-
return Tree::ImportNode.new(scanner.scan(/[
|
760
|
+
return Tree::ImportNode.new(scanner.scan(/[^,;]+/))
|
756
761
|
end
|
757
762
|
|
758
763
|
val = scanner[1] || scanner[2]
|
759
764
|
scanner.scan(/\s*/)
|
760
|
-
if media = scanner.scan(/[
|
765
|
+
if media = scanner.scan(/[^,;].*/)
|
761
766
|
Tree::DirectiveNode.new("@import #{str || uri} #{media}")
|
762
767
|
elsif uri
|
763
768
|
Tree::DirectiveNode.new("@import #{uri}")
|
data/lib/sass/exec.rb
CHANGED
@@ -229,6 +229,10 @@ END
|
|
229
229
|
'Only meaningful for --watch and --update.') do
|
230
230
|
@options[:stop_on_error] = true
|
231
231
|
end
|
232
|
+
opts.on('-f', '--force', 'Recompile all Sass files, even if the CSS file is newer.',
|
233
|
+
'Only meaningful for --update.') do
|
234
|
+
@options[:force] = true
|
235
|
+
end
|
232
236
|
opts.on('-c', '--check', "Just check syntax, don't evaluate.") do
|
233
237
|
require 'stringio'
|
234
238
|
@options[:check_syntax] = true
|
@@ -238,6 +242,10 @@ END
|
|
238
242
|
'Output style. Can be nested (default), compact, compressed, or expanded.') do |name|
|
239
243
|
@options[:for_engine][:style] = name.to_sym
|
240
244
|
end
|
245
|
+
opts.on('--precision NUMBER_OF_DIGITS', Integer,
|
246
|
+
'How many digits of precision to use when outputting decimal numbers. Defaults to 3.') do |precision|
|
247
|
+
::Sass::Script::Number.precision = precision
|
248
|
+
end
|
241
249
|
opts.on('-q', '--quiet', 'Silence warnings and status messages during compilation.') do
|
242
250
|
@options[:for_engine][:quiet] = true
|
243
251
|
end
|
@@ -350,6 +358,11 @@ END
|
|
350
358
|
::Sass::Plugin.options.merge! @options[:for_engine]
|
351
359
|
::Sass::Plugin.options[:unix_newlines] = @options[:unix_newlines]
|
352
360
|
|
361
|
+
if @options[:force]
|
362
|
+
raise "The --force flag may only be used with --update." unless @options[:update]
|
363
|
+
::Sass::Plugin.options[:always_update] = true
|
364
|
+
end
|
365
|
+
|
353
366
|
raise <<MSG if @args.empty?
|
354
367
|
What files should I watch? Did you mean something like:
|
355
368
|
#{@default_syntax} --watch input.#{@default_syntax}:output.css
|
@@ -372,7 +385,7 @@ MSG
|
|
372
385
|
|
373
386
|
dirs, files = @args.map {|name| split_colon_path(name)}.
|
374
387
|
partition {|i, _| File.directory? i}
|
375
|
-
files.map! {|from, to| [from, to || from.gsub(
|
388
|
+
files.map! {|from, to| [from, to || from.gsub(/\.[^.]*?$/, '.css')]}
|
376
389
|
dirs.map! {|from, to| [from, to || from]}
|
377
390
|
::Sass::Plugin.options[:template_location] = dirs
|
378
391
|
|
data/lib/sass/importers/base.rb
CHANGED
@@ -72,7 +72,8 @@ module Sass
|
|
72
72
|
# If no such files exist, it should return nil.
|
73
73
|
#
|
74
74
|
# The {Sass::Engine} to be returned should be passed `options`,
|
75
|
-
# with a few modifications. `:
|
75
|
+
# with a few modifications. `:syntax` should be set appropriately,
|
76
|
+
# `:filename` should be set to `uri`,
|
76
77
|
# and `:importer` should be set to this importer.
|
77
78
|
#
|
78
79
|
# @param uri [String] The URI to import.
|
data/lib/sass/script/number.rb
CHANGED
@@ -35,11 +35,34 @@ module Sass::Script
|
|
35
35
|
# @return [Boolean, nil]
|
36
36
|
attr_accessor :original
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
def self.precision
|
39
|
+
@precision ||= 3
|
40
|
+
end
|
41
|
+
|
42
|
+
# Sets the number of digits of precision
|
43
|
+
# For example, if this is `3`,
|
40
44
|
# `3.1415926` will be printed as `3.142`.
|
41
|
-
|
42
|
-
|
45
|
+
def self.precision=(digits)
|
46
|
+
@precision = digits.round
|
47
|
+
@precision_factor = 10.0**@precision
|
48
|
+
end
|
49
|
+
|
50
|
+
# the precision factor used in numeric output
|
51
|
+
# it is derived from the `precision` method.
|
52
|
+
def self.precision_factor
|
53
|
+
@precision_factor ||= 10.0**precision
|
54
|
+
end
|
55
|
+
|
56
|
+
# Handles the deprecation warning for the PRECISION constant
|
57
|
+
# This can be removed in 3.2.
|
58
|
+
def self.const_missing(const)
|
59
|
+
if const == :PRECISION
|
60
|
+
Sass::Util.sass_warn("Sass::Script::Number::PRECISION is deprecated and will be removed in a future release. Use Sass::Script::Number.precision_factor instead.")
|
61
|
+
const_set(:PRECISION, self.precision_factor)
|
62
|
+
else
|
63
|
+
super
|
64
|
+
end
|
65
|
+
end
|
43
66
|
|
44
67
|
# Used so we don't allocate two new arrays for each new number.
|
45
68
|
NO_UNITS = []
|
@@ -337,7 +360,7 @@ module Sass::Script
|
|
337
360
|
elsif num % 1 == 0.0
|
338
361
|
num.to_i
|
339
362
|
else
|
340
|
-
(num *
|
363
|
+
(num * self.precision_factor).round / self.precision_factor
|
341
364
|
end
|
342
365
|
end
|
343
366
|
|
data/lib/sass/scss/parser.rb
CHANGED
@@ -9,10 +9,12 @@ module Sass
|
|
9
9
|
# @param str [String, StringScanner] The source document to parse.
|
10
10
|
# Note that `Parser` *won't* raise a nice error message if this isn't properly parsed;
|
11
11
|
# for that, you should use the higher-level {Sass::Engine} or {Sass::CSS}.
|
12
|
+
# @param filename [String] The name of the file being parsed. Used for warnings.
|
12
13
|
# @param line [Fixnum] The line on which the source string appeared,
|
13
|
-
# if it's part of another document
|
14
|
-
def initialize(str, line = 1)
|
14
|
+
# if it's part of another document.
|
15
|
+
def initialize(str, filename, line = 1)
|
15
16
|
@template = str
|
17
|
+
@filename = filename
|
16
18
|
@line = line
|
17
19
|
@strs = []
|
18
20
|
end
|
@@ -487,21 +489,30 @@ module Sass
|
|
487
489
|
res = [e]
|
488
490
|
|
489
491
|
# The tok(/\*/) allows the "E*" hack
|
490
|
-
while v =
|
491
|
-
|
492
|
-
(tok(/\*/) && Selector::Universal.new(nil))
|
492
|
+
while v = id_selector || class_selector || attrib || negation || pseudo ||
|
493
|
+
interpolation_selector || (tok(/\*/) && Selector::Universal.new(nil))
|
493
494
|
res << v
|
494
495
|
end
|
495
496
|
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
497
|
+
pos = @scanner.pos
|
498
|
+
line = @line
|
499
|
+
if sel = str? {simple_selector_sequence}
|
500
|
+
@scanner.pos = pos
|
501
|
+
@line = line
|
502
|
+
|
503
|
+
if sel =~ /^&/
|
504
|
+
begin
|
505
|
+
expected('"{"')
|
506
|
+
rescue Sass::SyntaxError => e
|
507
|
+
e.message << "\n\n\"#{sel}\" may only be used at the beginning of a selector."
|
508
|
+
raise e
|
509
|
+
end
|
510
|
+
else
|
511
|
+
Sass::Util.sass_warn(<<MESSAGE)
|
512
|
+
DEPRECATION WARNING:
|
513
|
+
On line #{@line}#{" of \"#{@filename}\"" if @filename}, after "#{self.class.prior_snippet(@scanner)}"
|
514
|
+
Starting in Sass 3.2, "#{sel}" may only be used at the beginning of a selector.
|
503
515
|
MESSAGE
|
504
|
-
raise e
|
505
516
|
end
|
506
517
|
end
|
507
518
|
|
@@ -875,16 +886,6 @@ MESSAGE
|
|
875
886
|
|
876
887
|
# @private
|
877
888
|
def self.expected(scanner, expected, line)
|
878
|
-
pos = scanner.pos
|
879
|
-
|
880
|
-
after = scanner.string[0...pos]
|
881
|
-
# Get rid of whitespace between pos and the last token,
|
882
|
-
# but only if there's a newline in there
|
883
|
-
after.gsub!(/\s*\n\s*$/, '')
|
884
|
-
# Also get rid of stuff before the last newline
|
885
|
-
after.gsub!(/.*\n/, '')
|
886
|
-
after = "..." + after[-15..-1] if after.size > 18
|
887
|
-
|
888
889
|
was = scanner.rest.dup
|
889
890
|
# Get rid of whitespace between pos and the next token,
|
890
891
|
# but only if there's a newline in there
|
@@ -894,10 +895,24 @@ MESSAGE
|
|
894
895
|
was = was[0...15] + "..." if was.size > 18
|
895
896
|
|
896
897
|
raise Sass::SyntaxError.new(
|
897
|
-
"Invalid CSS after \"#{
|
898
|
+
"Invalid CSS after \"#{prior_snippet(scanner)}\": expected #{expected}, was \"#{was}\"",
|
898
899
|
:line => line)
|
899
900
|
end
|
900
901
|
|
902
|
+
# @private
|
903
|
+
def self.prior_snippet(scanner)
|
904
|
+
pos = scanner.pos
|
905
|
+
|
906
|
+
after = scanner.string[0...pos]
|
907
|
+
# Get rid of whitespace between pos and the last token,
|
908
|
+
# but only if there's a newline in there
|
909
|
+
after.gsub!(/\s*\n\s*$/, '')
|
910
|
+
# Also get rid of stuff before the last newline
|
911
|
+
after.gsub!(/.*\n/, '')
|
912
|
+
after = "..." + after[-15..-1] if after.size > 18
|
913
|
+
after
|
914
|
+
end
|
915
|
+
|
901
916
|
# Avoid allocating lots of new strings for `#tok`.
|
902
917
|
# This is important because `#tok` is called all the time.
|
903
918
|
NEWLINE = "\n"
|
@@ -13,12 +13,12 @@ module Sass
|
|
13
13
|
# Used for error reporting.
|
14
14
|
# @return [Selector::CommaSequence] The parsed selector
|
15
15
|
# @raise [Sass::SyntaxError] if there's a syntax error in the selector
|
16
|
-
def parse_selector
|
16
|
+
def parse_selector
|
17
17
|
init_scanner!
|
18
18
|
seq = expr!(:selector_comma_sequence)
|
19
19
|
expected("selector") unless @scanner.eos?
|
20
20
|
seq.line = @line
|
21
|
-
seq.filename = filename
|
21
|
+
seq.filename = @filename
|
22
22
|
seq
|
23
23
|
end
|
24
24
|
|
data/lib/sass/tree/rule_node.rb
CHANGED
@@ -128,8 +128,8 @@ module Sass::Tree
|
|
128
128
|
if @rule.all? {|t| t.kind_of?(String)}
|
129
129
|
# We don't use real filename/line info because we don't have it yet.
|
130
130
|
# When we get it, we'll set it on the parsed rules if possible.
|
131
|
-
parser = Sass::SCSS::StaticParser.new(@rule.join.strip, 1)
|
132
|
-
@parsed_rules = parser.parse_selector
|
131
|
+
parser = Sass::SCSS::StaticParser.new(@rule.join.strip, '', 1)
|
132
|
+
@parsed_rules = parser.parse_selector rescue nil
|
133
133
|
end
|
134
134
|
end
|
135
135
|
end
|
@@ -89,8 +89,8 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
|
|
89
89
|
# Runs SassScript interpolation in the selector,
|
90
90
|
# and then parses the result into a {Sass::Selector::CommaSequence}.
|
91
91
|
def visit_extend(node)
|
92
|
-
parser = Sass::SCSS::CssParser.new(run_interp(node.selector), node.line)
|
93
|
-
node.resolved_selector = parser.parse_selector
|
92
|
+
parser = Sass::SCSS::CssParser.new(run_interp(node.selector), node.filename, node.line)
|
93
|
+
node.resolved_selector = parser.parse_selector
|
94
94
|
node
|
95
95
|
end
|
96
96
|
|
@@ -142,6 +142,7 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
|
|
142
142
|
|
143
143
|
@environment.push_frame(:filename => node.filename, :line => node.line)
|
144
144
|
root = node.imported_file.to_tree
|
145
|
+
Sass::Tree::Visitors::CheckNesting.visit(root)
|
145
146
|
node.children = root.children.map {|c| visit(c)}.flatten
|
146
147
|
node
|
147
148
|
rescue Sass::SyntaxError => e
|
@@ -225,8 +226,8 @@ END
|
|
225
226
|
# Runs SassScript interpolation in the selector,
|
226
227
|
# and then parses the result into a {Sass::Selector::CommaSequence}.
|
227
228
|
def visit_rule(node)
|
228
|
-
parser = Sass::SCSS::StaticParser.new(run_interp(node.rule), node.line)
|
229
|
-
node.parsed_rules ||= parser.parse_selector
|
229
|
+
parser = Sass::SCSS::StaticParser.new(run_interp(node.rule), node.filename, node.line)
|
230
|
+
node.parsed_rules ||= parser.parse_selector
|
230
231
|
if node.options[:trace_selectors]
|
231
232
|
@environment.push_frame(:filename => node.filename, :line => node.line)
|
232
233
|
node.stack_trace = @environment.stack_trace
|
@@ -250,7 +251,8 @@ END
|
|
250
251
|
res = res.value if res.is_a?(Sass::Script::String)
|
251
252
|
msg = "WARNING: #{res}\n "
|
252
253
|
msg << @environment.stack_trace.join("\n ")
|
253
|
-
|
254
|
+
# JRuby doesn't automatically add a newline for #warn
|
255
|
+
msg << (RUBY_PLATFORM =~ /java/ ? "\n\n" : "\n")
|
254
256
|
Sass::Util.sass_warn msg
|
255
257
|
[]
|
256
258
|
ensure
|
data/test/Gemfile
ADDED
data/test/Gemfile.lock
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
less (1.2.21)
|
5
|
+
mutter (>= 0.4.2)
|
6
|
+
treetop (>= 1.4.2)
|
7
|
+
mutter (0.5.3)
|
8
|
+
polyglot (0.3.2)
|
9
|
+
rake (0.9.2)
|
10
|
+
treetop (1.4.10)
|
11
|
+
polyglot
|
12
|
+
polyglot (>= 0.3.1)
|
13
|
+
|
14
|
+
PLATFORMS
|
15
|
+
ruby
|
16
|
+
|
17
|
+
DEPENDENCIES
|
18
|
+
less (< 2.0.0)
|
19
|
+
rake
|
data/test/sass/css2sass_test.rb
CHANGED
data/test/sass/engine_test.rb
CHANGED
@@ -62,6 +62,7 @@ MSG
|
|
62
62
|
"foo\n @import foo.css" => "CSS import directives may only be used at the root of a document.",
|
63
63
|
"@if true\n @import foo" => "Import directives may not be used within control directives or mixins.",
|
64
64
|
"@mixin foo\n @import foo" => "Import directives may not be used within control directives or mixins.",
|
65
|
+
"@import foo;" => "Invalid @import: expected end of line, was \";\".",
|
65
66
|
'$foo: "bar" "baz" !' => %Q{Invalid CSS after ""bar" "baz" ": expected expression (e.g. 1px, bold), was "!"},
|
66
67
|
'$foo: "bar" "baz" $' => %Q{Invalid CSS after ""bar" "baz" ": expected expression (e.g. 1px, bold), was "$"},
|
67
68
|
"=foo\n :color red\n.bar\n +bang" => "Undefined mixin 'bang'.",
|
@@ -258,7 +259,7 @@ SASS
|
|
258
259
|
end
|
259
260
|
|
260
261
|
def test_imported_exception
|
261
|
-
[1, 2, 3, 4].each do |i|
|
262
|
+
[1, 2, 3, 4, 5].each do |i|
|
262
263
|
begin
|
263
264
|
Sass::Engine.new("@import bork#{i}", :load_paths => [File.dirname(__FILE__) + '/templates/']).render
|
264
265
|
rescue Sass::SyntaxError => err
|
@@ -280,7 +281,7 @@ SASS
|
|
280
281
|
end
|
281
282
|
|
282
283
|
def test_double_imported_exception
|
283
|
-
[1, 2, 3, 4].each do |i|
|
284
|
+
[1, 2, 3, 4, 5].each do |i|
|
284
285
|
begin
|
285
286
|
Sass::Engine.new("@import nested_bork#{i}", :load_paths => [File.dirname(__FILE__) + '/templates/']).render
|
286
287
|
rescue Sass::SyntaxError => err
|
@@ -1793,11 +1794,11 @@ SASS
|
|
1793
1794
|
|
1794
1795
|
def test_interpolation_doesnt_deep_unquote_strings
|
1795
1796
|
assert_equal(<<CSS, render(<<SASS))
|
1796
|
-
.foo
|
1797
|
-
a:
|
1797
|
+
.foo {
|
1798
|
+
a: "bar" "baz"; }
|
1798
1799
|
CSS
|
1799
|
-
.foo
|
1800
|
-
a:
|
1800
|
+
.foo
|
1801
|
+
a: \#{"bar" "baz"}
|
1801
1802
|
SASS
|
1802
1803
|
end
|
1803
1804
|
|
@@ -2451,6 +2452,27 @@ SASS
|
|
2451
2452
|
assert_equal original_filename, importer.engine("imported").options[:original_filename]
|
2452
2453
|
end
|
2453
2454
|
|
2455
|
+
def test_deprecated_PRECISION
|
2456
|
+
assert_warning(<<END) {assert_equal 1000.0, Sass::Script::Number::PRECISION}
|
2457
|
+
Sass::Script::Number::PRECISION is deprecated and will be removed in a future release. Use Sass::Script::Number.precision_factor instead.
|
2458
|
+
END
|
2459
|
+
end
|
2460
|
+
def test_changing_precision
|
2461
|
+
begin
|
2462
|
+
Sass::Script::Number.precision = 8
|
2463
|
+
assert_equal <<CSS, render(<<SASS)
|
2464
|
+
div {
|
2465
|
+
maximum: 1.00000001;
|
2466
|
+
too-much: 1.0; }
|
2467
|
+
CSS
|
2468
|
+
div
|
2469
|
+
maximum : 1.00000001
|
2470
|
+
too-much: 1.000000001
|
2471
|
+
SASS
|
2472
|
+
ensure
|
2473
|
+
Sass::Script::Number.precision = 3
|
2474
|
+
end
|
2475
|
+
end
|
2454
2476
|
|
2455
2477
|
private
|
2456
2478
|
|
data/test/sass/scss/css_test.rb
CHANGED
@@ -909,7 +909,7 @@ SCSS
|
|
909
909
|
end
|
910
910
|
|
911
911
|
def render(scss, options = {})
|
912
|
-
tree = Sass::SCSS::CssParser.new(scss).parse
|
912
|
+
tree = Sass::SCSS::CssParser.new(scss, options[:filename]).parse
|
913
913
|
tree.options = Sass::Engine::DEFAULT_OPTIONS.merge(options)
|
914
914
|
tree.render
|
915
915
|
end
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -118,11 +118,11 @@ SCSS
|
|
118
118
|
def test_warn_directive
|
119
119
|
expected_warning = <<EXPECTATION
|
120
120
|
WARNING: this is a warning
|
121
|
-
|
121
|
+
on line 2 of test_warn_directive_inline.scss
|
122
122
|
|
123
123
|
WARNING: this is a mixin
|
124
|
-
|
125
|
-
|
124
|
+
on line 1 of test_warn_directive_inline.scss, in `foo'
|
125
|
+
from line 3 of test_warn_directive_inline.scss
|
126
126
|
EXPECTATION
|
127
127
|
assert_warning expected_warning do
|
128
128
|
assert_equal <<CSS, render(<<SCSS)
|
@@ -892,7 +892,8 @@ SCSS
|
|
892
892
|
end
|
893
893
|
|
894
894
|
def test_uses_property_exception_with_star_hack
|
895
|
-
|
895
|
+
# Silence the "beginning of selector" warning
|
896
|
+
Sass::Util.silence_warnings {render <<SCSS}
|
896
897
|
foo {
|
897
898
|
*bar:baz [fail]; }
|
898
899
|
SCSS
|
@@ -1029,11 +1030,10 @@ SCSS
|
|
1029
1030
|
end
|
1030
1031
|
|
1031
1032
|
def test_parent_in_mid_selector_error
|
1032
|
-
assert_raise_message(Sass::SyntaxError, <<MESSAGE) {render <<SCSS}
|
1033
|
+
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
|
1033
1034
|
Invalid CSS after ".foo": expected "{", was "&.bar"
|
1034
1035
|
|
1035
|
-
|
1036
|
-
since it could potentially be replaced by an element name.
|
1036
|
+
"&" may only be used at the beginning of a selector.
|
1037
1037
|
MESSAGE
|
1038
1038
|
flim {
|
1039
1039
|
.foo&.bar {a: b}
|
@@ -1042,11 +1042,10 @@ SCSS
|
|
1042
1042
|
end
|
1043
1043
|
|
1044
1044
|
def test_parent_in_mid_selector_error
|
1045
|
-
assert_raise_message(Sass::SyntaxError, <<MESSAGE) {render <<SCSS}
|
1045
|
+
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
|
1046
1046
|
Invalid CSS after " .foo.bar": expected "{", was "& {a: b}"
|
1047
1047
|
|
1048
|
-
|
1049
|
-
since it could potentially be replaced by an element name.
|
1048
|
+
"&" may only be used at the beginning of a selector.
|
1050
1049
|
MESSAGE
|
1051
1050
|
flim {
|
1052
1051
|
.foo.bar& {a: b}
|
@@ -1055,11 +1054,10 @@ SCSS
|
|
1055
1054
|
end
|
1056
1055
|
|
1057
1056
|
def test_double_parent_selector_error
|
1058
|
-
assert_raise_message(Sass::SyntaxError, <<MESSAGE) {render <<SCSS}
|
1057
|
+
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
|
1059
1058
|
Invalid CSS after " &": expected "{", was "& {a: b}"
|
1060
1059
|
|
1061
|
-
|
1062
|
-
since it could potentially be replaced by an element name.
|
1060
|
+
"&" may only be used at the beginning of a selector.
|
1063
1061
|
MESSAGE
|
1064
1062
|
flim {
|
1065
1063
|
&& {a: b}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 8
|
10
|
+
version: 3.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Weizenbaum
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-
|
20
|
+
date: 2011-09-30 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -57,6 +57,7 @@ email: sass-lang@googlegroups.com
|
|
57
57
|
executables:
|
58
58
|
- sass
|
59
59
|
- sass-convert
|
60
|
+
- scss
|
60
61
|
extensions: []
|
61
62
|
|
62
63
|
extra_rdoc_files: []
|
@@ -198,6 +199,8 @@ files:
|
|
198
199
|
- bin/sass-convert
|
199
200
|
- bin/scss
|
200
201
|
- bin/sass
|
202
|
+
- test/Gemfile
|
203
|
+
- test/Gemfile.lock
|
201
204
|
- test/test_helper.rb
|
202
205
|
- test/sass/engine_test.rb
|
203
206
|
- test/sass/functions_test.rb
|
@@ -225,6 +228,8 @@ files:
|
|
225
228
|
- test/sass/templates/line_numbers.sass
|
226
229
|
- test/sass/templates/expanded.sass
|
227
230
|
- test/sass/templates/bork3.sass
|
231
|
+
- test/sass/templates/bork5.sass
|
232
|
+
- test/sass/templates/nested_bork5.sass
|
228
233
|
- test/sass/templates/warn_imported.sass
|
229
234
|
- test/sass/templates/import_charset_ibm866.sass
|
230
235
|
- test/sass/templates/bork1.sass
|
@@ -320,10 +325,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
320
325
|
requirements:
|
321
326
|
- - ">="
|
322
327
|
- !ruby/object:Gem::Version
|
323
|
-
hash:
|
328
|
+
hash: 57
|
324
329
|
segments:
|
325
|
-
-
|
326
|
-
|
330
|
+
- 1
|
331
|
+
- 8
|
332
|
+
- 7
|
333
|
+
version: 1.8.7
|
327
334
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
328
335
|
none: false
|
329
336
|
requirements:
|