sass 3.3.3 → 3.3.4
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/cache_stores/filesystem.rb +6 -2
- data/lib/sass/importers/filesystem.rb +2 -1
- data/lib/sass/plugin/staleness_checker.rb +1 -1
- data/lib/sass/script/functions.rb +6 -6
- data/lib/sass/script/value/base.rb +1 -1
- data/lib/sass/script/value/deprecated_false.rb +1 -1
- data/lib/sass/selector.rb +1 -1
- data/lib/sass/selector/simple_sequence.rb +1 -1
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/directive_node.rb +1 -1
- data/lib/sass/tree/extend_node.rb +1 -1
- data/lib/sass/tree/rule_node.rb +1 -1
- data/lib/sass/tree/visitors/check_nesting.rb +6 -2
- data/lib/sass/util.rb +6 -1
- data/lib/sass/util/subset_map.rb +1 -1
- data/test/sass/compiler_test.rb +1 -1
- data/test/sass/css2sass_test.rb +1 -1
- data/test/sass/extend_test.rb +2 -2
- data/test/sass/functions_test.rb +4 -4
- data/test/sass/script_conversion_test.rb +3 -3
- data/test/sass/scss/css_test.rb +2 -2
- data/test/sass/scss/scss_test.rb +14 -3
- data/test/sass/util_test.rb +21 -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: e01f4f4c3ddb4b26467c0ba857d8472415830997
|
4
|
+
data.tar.gz: d0ac7a66e45fba34fe08aff86472371b816a8928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0e2df2d14eac32d04038eeb293cc98b60daaf1b0de4d6132c4284c90d212fd7d2c29b5a66c5d13ab33aaf65238bb1b4930f01e7bff04c160c2ac19fa7fa088
|
7
|
+
data.tar.gz: c455f23cd577a8b7f5464bfb8eead044184bf2402218bec37fdfd3a7e05cf4e4b564fb69c6c4288ae09b8a3fae1815cb5c85fe98ef1e0c492c910f63df5c1a3f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.4
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
21 March 2014 23:43:07 UTC
|
@@ -22,7 +22,11 @@ module Sass
|
|
22
22
|
return f.read
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
25
|
+
begin
|
26
|
+
File.unlink path_to(key)
|
27
|
+
rescue Errno::ENOENT
|
28
|
+
# Already deleted. Race condition?
|
29
|
+
end
|
26
30
|
nil
|
27
31
|
rescue EOFError, TypeError, ArgumentError => e
|
28
32
|
Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
|
@@ -32,7 +36,7 @@ module Sass
|
|
32
36
|
def _store(key, version, sha, contents)
|
33
37
|
compiled_filename = path_to(key)
|
34
38
|
FileUtils.mkdir_p(File.dirname(compiled_filename))
|
35
|
-
Sass::Util.atomic_create_and_write_file(compiled_filename) do |f|
|
39
|
+
Sass::Util.atomic_create_and_write_file(compiled_filename, 0600) do |f|
|
36
40
|
f.puts(version)
|
37
41
|
f.puts(sha)
|
38
42
|
f.write(contents)
|
@@ -139,8 +139,9 @@ module Sass
|
|
139
139
|
# @param name [String] The filename to search for.
|
140
140
|
# @return [(String, Symbol)] A filename-syntax pair.
|
141
141
|
def find_real_file(dir, name, options)
|
142
|
-
#
|
142
|
+
# On windows 'dir' or 'name' can be in native File::ALT_SEPARATOR form.
|
143
143
|
dir = dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR) unless File::ALT_SEPARATOR.nil?
|
144
|
+
name = name.gsub(File::ALT_SEPARATOR, File::SEPARATOR) unless File::ALT_SEPARATOR.nil?
|
144
145
|
|
145
146
|
found = possible_files(remove_root(name)).map do |f, s|
|
146
147
|
path = (dir == "." || Sass::Util.pathname(f).absolute?) ? f :
|
@@ -46,7 +46,7 @@ module Sass
|
|
46
46
|
@actively_checking = Set.new
|
47
47
|
|
48
48
|
# Entries in the following instance-level caches are never explicitly expired.
|
49
|
-
# Instead they are supposed to
|
49
|
+
# Instead they are supposed to automatically go out of scope when a series of staleness
|
50
50
|
# checks (this instance of StalenessChecker was created for) is finished.
|
51
51
|
@mtimes, @dependencies_stale, @parse_trees = {}, {}, {}
|
52
52
|
@options = Sass::Engine.normalize_options(options)
|
@@ -922,7 +922,7 @@ module Sass::Script
|
|
922
922
|
# darken(#800, 20%) => #200
|
923
923
|
# @overload darken($color, $amount)
|
924
924
|
# @param $color [Sass::Script::Value::Color]
|
925
|
-
# @param $amount [Sass::Script::Value::Number] The amount to
|
925
|
+
# @param $amount [Sass::Script::Value::Number] The amount to decrease the
|
926
926
|
# lightness by, between `0%` and `100%`
|
927
927
|
# @return [Sass::Script::Value::Color]
|
928
928
|
# @raise [ArgumentError] if `$amount` is out of bounds, or either parameter
|
@@ -980,7 +980,7 @@ module Sass::Script
|
|
980
980
|
#
|
981
981
|
# @example
|
982
982
|
# adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%)
|
983
|
-
# adjust-hue(hsl(120, 30%, 90%),
|
983
|
+
# adjust-hue(hsl(120, 30%, 90%), -60deg) => hsl(60, 30%, 90%)
|
984
984
|
# adjust-hue(#811, 45deg) => #886a11
|
985
985
|
# @overload adjust_hue($color, $degrees)
|
986
986
|
# @param $color [Sass::Script::Value::Color]
|
@@ -1411,8 +1411,8 @@ module Sass::Script
|
|
1411
1411
|
end
|
1412
1412
|
declare :str_insert, [:string, :insert, :index]
|
1413
1413
|
|
1414
|
-
# Returns the index of the first
|
1415
|
-
# there is no such
|
1414
|
+
# Returns the index of the first occurrence of `$substring` in `$string`. If
|
1415
|
+
# there is no such occurrence, returns `null`.
|
1416
1416
|
#
|
1417
1417
|
# Note that unlike some languages, the first character in a Sass string is
|
1418
1418
|
# number 1, the second number 2, and so forth.
|
@@ -1885,7 +1885,7 @@ module Sass::Script
|
|
1885
1885
|
# @example
|
1886
1886
|
# index(1px solid red, solid) => 2
|
1887
1887
|
# index(1px solid red, dashed) => null
|
1888
|
-
# index((width: 10px, height: 20px), (height
|
1888
|
+
# index((width: 10px, height: 20px), (height 20px)) => 2
|
1889
1889
|
# @overload index($list, $value)
|
1890
1890
|
# @param $list [Sass::Script::Value::Base]
|
1891
1891
|
# @param $value [Sass::Script::Value::Base]
|
@@ -2212,7 +2212,7 @@ module Sass::Script
|
|
2212
2212
|
# Return a string containing the value as its Sass representation.
|
2213
2213
|
#
|
2214
2214
|
# @param value [Sass::Script::Value::Base] The value to inspect.
|
2215
|
-
# @return [Sass::Script::Value::String] A
|
2215
|
+
# @return [Sass::Script::Value::String] A representation of the value as
|
2216
2216
|
# it would be written in Sass.
|
2217
2217
|
def inspect(value)
|
2218
2218
|
unquoted_string(value.to_sass)
|
@@ -24,7 +24,7 @@ module Sass::Script::Value
|
|
24
24
|
DEPRECATION WARNING: The return value of index() will change from "false" to
|
25
25
|
"null" in future versions of Sass. For compatibility, avoid using "== false" on
|
26
26
|
the return value. For example, instead of "@if index(...) == false", just write
|
27
|
-
"@if index(...)".
|
27
|
+
"@if not index(...)".
|
28
28
|
WARNING
|
29
29
|
end
|
30
30
|
Bool.new(other.value == false)
|
data/lib/sass/selector.rb
CHANGED
@@ -7,7 +7,7 @@ require 'sass/selector/simple_sequence'
|
|
7
7
|
module Sass
|
8
8
|
# A namespace for nodes in the parse tree for selectors.
|
9
9
|
#
|
10
|
-
# {CommaSequence} is the toplevel
|
10
|
+
# {CommaSequence} is the toplevel selector,
|
11
11
|
# representing a comma-separated sequence of {Sequence}s,
|
12
12
|
# such as `foo bar, baz bang`.
|
13
13
|
# {Sequence} is the next level,
|
@@ -128,7 +128,7 @@ module Sass
|
|
128
128
|
end)
|
129
129
|
end
|
130
130
|
|
131
|
-
# Non-
|
131
|
+
# Non-destructively extends this selector with the extensions specified in a hash
|
132
132
|
# (which should come from {Sass::Tree::Visitors::Cssize}).
|
133
133
|
#
|
134
134
|
# @overload do_extend(extends, parent_directives)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Sass::Tree
|
2
|
-
# A static node representing an
|
2
|
+
# A static node representing an unprocessed Sass `@`-directive.
|
3
3
|
# Directives known to Sass, like `@for` and `@debug`,
|
4
4
|
# are handled by their own nodes;
|
5
5
|
# only CSS directives like `@media` and `@font-face` become {DirectiveNode}s.
|
data/lib/sass/tree/rule_node.rb
CHANGED
@@ -23,8 +23,12 @@ class Sass::Tree::Visitors::CheckNesting < Sass::Tree::Visitors::Base
|
|
23
23
|
SCRIPT_NODES = [Sass::Tree::ImportNode] + CONTROL_NODES
|
24
24
|
def visit_children(parent)
|
25
25
|
old_parent = @parent
|
26
|
-
|
27
|
-
|
26
|
+
unless is_any_of?(parent, SCRIPT_NODES) ||
|
27
|
+
(parent.bubbles? &&
|
28
|
+
!old_parent.is_a?(Sass::Tree::RootNode) &&
|
29
|
+
!old_parent.is_a?(Sass::Tree::AtRootNode))
|
30
|
+
@parent = parent
|
31
|
+
end
|
28
32
|
@parents.push parent
|
29
33
|
super
|
30
34
|
ensure
|
data/lib/sass/util.rb
CHANGED
@@ -1149,15 +1149,20 @@ MSG
|
|
1149
1149
|
# rename operation.
|
1150
1150
|
#
|
1151
1151
|
# @param filename [String] The file to write to.
|
1152
|
+
# @param perms [Integer] The permissions used for creating this file.
|
1153
|
+
# Will be masked by the process umask. Defaults to readable/writeable
|
1154
|
+
# by all users however the umask usually changes this to only be writable
|
1155
|
+
# by the process's user.
|
1152
1156
|
# @yieldparam tmpfile [Tempfile] The temp file that can be written to.
|
1153
1157
|
# @return The value returned by the block.
|
1154
|
-
def atomic_create_and_write_file(filename)
|
1158
|
+
def atomic_create_and_write_file(filename, perms = 0666)
|
1155
1159
|
require 'tempfile'
|
1156
1160
|
tmpfile = Tempfile.new(File.basename(filename), File.dirname(filename))
|
1157
1161
|
tmpfile.binmode if tmpfile.respond_to?(:binmode)
|
1158
1162
|
result = yield tmpfile
|
1159
1163
|
tmpfile.close
|
1160
1164
|
ATOMIC_WRITE_MUTEX.synchronize do
|
1165
|
+
File.chmod(perms & ~File.umask, tmpfile.path)
|
1161
1166
|
File.rename tmpfile.path, filename
|
1162
1167
|
end
|
1163
1168
|
result
|
data/lib/sass/util/subset_map.rb
CHANGED
@@ -59,7 +59,7 @@ module Sass
|
|
59
59
|
#
|
60
60
|
# In the worst case, this runs in `O(m*max(n, log m))` time,
|
61
61
|
# where `n` is the size of `set`
|
62
|
-
# and `m` is the number of
|
62
|
+
# and `m` is the number of associations in the map.
|
63
63
|
# However, unless many keys in the map overlap with `set`,
|
64
64
|
# `m` will typically be much smaller.
|
65
65
|
#
|
data/test/sass/compiler_test.rb
CHANGED
data/test/sass/css2sass_test.rb
CHANGED
data/test/sass/extend_test.rb
CHANGED
@@ -145,8 +145,8 @@ SCSS
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def test_class_unification
|
148
|
-
assert_unification '.foo.bar', '.baz {@extend .foo}', '.foo.bar, .bar.baz'
|
149
|
-
assert_unification '.foo.baz', '.baz {@extend .foo}', '.baz'
|
148
|
+
assert_unification '.foo.bar', '.baz {@extend .foo}', '.foo.bar, .bar.baz'
|
149
|
+
assert_unification '.foo.baz', '.baz {@extend .foo}', '.baz'
|
150
150
|
end
|
151
151
|
|
152
152
|
def test_id_unification
|
data/test/sass/functions_test.rb
CHANGED
@@ -1274,7 +1274,7 @@ WARNING
|
|
1274
1274
|
DEPRECATION WARNING: The return value of index() will change from "false" to
|
1275
1275
|
"null" in future versions of Sass. For compatibility, avoid using "== false" on
|
1276
1276
|
the return value. For example, instead of "@if index(...) == false", just write
|
1277
|
-
"@if index(...)".
|
1277
|
+
"@if not index(...)".
|
1278
1278
|
WARNING
|
1279
1279
|
assert_equal("true", evaluate("index(1, 2 3 4) == false"))
|
1280
1280
|
end
|
@@ -1291,7 +1291,7 @@ WARNING
|
|
1291
1291
|
DEPRECATION WARNING: The return value of index() will change from "false" to
|
1292
1292
|
"null" in future versions of Sass. For compatibility, avoid using "== false" on
|
1293
1293
|
the return value. For example, instead of "@if index(...) == false", just write
|
1294
|
-
"@if index(...)".
|
1294
|
+
"@if not index(...)".
|
1295
1295
|
WARNING
|
1296
1296
|
assert_equal("true", evaluate("false == index(1, 2 3 4)"))
|
1297
1297
|
end
|
@@ -1310,12 +1310,12 @@ WARNING
|
|
1310
1310
|
DEPRECATION WARNING: The return value of index() will change from "false" to
|
1311
1311
|
"null" in future versions of Sass. For compatibility, avoid using "== false" on
|
1312
1312
|
the return value. For example, instead of "@if index(...) == false", just write
|
1313
|
-
"@if index(...)".
|
1313
|
+
"@if not index(...)".
|
1314
1314
|
on line 3 of test_index_deprecation_warning_is_only_emitted_once_per_call_inline.scss
|
1315
1315
|
DEPRECATION WARNING: The return value of index() will change from "false" to
|
1316
1316
|
"null" in future versions of Sass. For compatibility, avoid using "== false" on
|
1317
1317
|
the return value. For example, instead of "@if index(...) == false", just write
|
1318
|
-
"@if index(...)".
|
1318
|
+
"@if not index(...)".
|
1319
1319
|
on line 6 of test_index_deprecation_warning_is_only_emitted_once_per_call_inline.scss
|
1320
1320
|
WARNING
|
1321
1321
|
render(<<SCSS)
|
@@ -113,7 +113,7 @@ class SassScriptConversionTest < Test::Unit::TestCase
|
|
113
113
|
op_outer = Sass::Script::Lexer::OPERATORS_REVERSE[outer]
|
114
114
|
op_inner = Sass::Script::Lexer::OPERATORS_REVERSE[inner]
|
115
115
|
class_eval <<RUBY
|
116
|
-
def test_precedence_#{outer}_#{inner}
|
116
|
+
def test_precedence_#{outer}_#{inner}
|
117
117
|
assert_renders "$foo #{op_outer} $bar #{op_inner} $baz"
|
118
118
|
assert_renders "$foo #{op_inner} $bar #{op_outer} $baz"
|
119
119
|
|
@@ -132,7 +132,7 @@ RUBY
|
|
132
132
|
op = separator_for(op_name)
|
133
133
|
sibling = separator_for(sibling_name)
|
134
134
|
class_eval <<RUBY
|
135
|
-
def test_associative_#{op_name}_#{sibling_name}
|
135
|
+
def test_associative_#{op_name}_#{sibling_name}
|
136
136
|
assert_renders "$foo#{op}$bar#{op}$baz"
|
137
137
|
|
138
138
|
assert_equal "$foo#{op}$bar#{op}$baz",
|
@@ -160,7 +160,7 @@ RUBY
|
|
160
160
|
op = Sass::Script::Lexer::OPERATORS_REVERSE[op_name]
|
161
161
|
sibling = Sass::Script::Lexer::OPERATORS_REVERSE[sibling_name]
|
162
162
|
class_eval <<RUBY
|
163
|
-
def test_non_associative_#{op_name}_#{sibling_name}
|
163
|
+
def test_non_associative_#{op_name}_#{sibling_name}
|
164
164
|
assert_renders "$foo #{op} $bar #{op} $baz"
|
165
165
|
|
166
166
|
assert_renders "$foo #{op} ($bar #{op} $baz)"
|
data/test/sass/scss/css_test.rb
CHANGED
@@ -94,7 +94,7 @@ foo {a /*: b; c */: d}
|
|
94
94
|
SCSS
|
95
95
|
end
|
96
96
|
|
97
|
-
def test_crazy_comments
|
97
|
+
def test_crazy_comments
|
98
98
|
# http://www.w3.org/Style/CSS/Test/CSS2.1/current/xhtml1/t040109-c17-comments-00-b.xht
|
99
99
|
assert_equal <<CSS, render(<<SCSS)
|
100
100
|
/* This is a CSS comment. */
|
@@ -836,7 +836,7 @@ SCSS
|
|
836
836
|
|
837
837
|
def assert_selector_can_contain_selectors(sel)
|
838
838
|
try = lambda {|subsel| assert_selector_parses(sel.gsub('<sel>', subsel))}
|
839
|
-
|
839
|
+
|
840
840
|
try['foo|bar']
|
841
841
|
try['*|bar']
|
842
842
|
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -3099,7 +3099,18 @@ SCSS
|
|
3099
3099
|
end
|
3100
3100
|
|
3101
3101
|
# Regression
|
3102
|
-
|
3102
|
+
|
3103
|
+
def test_top_level_unknown_directive_in_at_root
|
3104
|
+
assert_equal(<<CSS, render(<<SCSS))
|
3105
|
+
@fblthp {
|
3106
|
+
a: b; }
|
3107
|
+
CSS
|
3108
|
+
@at-root {
|
3109
|
+
@fblthp {a: b}
|
3110
|
+
}
|
3111
|
+
SCSS
|
3112
|
+
end
|
3113
|
+
|
3103
3114
|
def test_parent_ref_with_newline
|
3104
3115
|
assert_equal(<<CSS, render(<<SCSS))
|
3105
3116
|
a.c
|
@@ -3422,10 +3433,10 @@ SCSS
|
|
3422
3433
|
}
|
3423
3434
|
.aaa .aaa .aaa {
|
3424
3435
|
background-color: black;
|
3425
|
-
}
|
3436
|
+
}
|
3426
3437
|
.bbb {
|
3427
3438
|
@extend .aaa;
|
3428
|
-
}
|
3439
|
+
}
|
3429
3440
|
.xxx {
|
3430
3441
|
@extend .bbb;
|
3431
3442
|
}
|
data/test/sass/util_test.rb
CHANGED
@@ -419,6 +419,27 @@ WARNING
|
|
419
419
|
end
|
420
420
|
end
|
421
421
|
|
422
|
+
def test_atomic_write_permissions
|
423
|
+
atomic_filename = File.join(Dir.tmpdir, "test_atomic_perms.atomic")
|
424
|
+
normal_filename = File.join(Dir.tmpdir, "test_atomic_perms.normal")
|
425
|
+
atomic_create_and_write_file(atomic_filename) {|f| f.write("whatever\n") }
|
426
|
+
open(normal_filename, "wb") {|f| f.write("whatever\n") }
|
427
|
+
assert_equal File.stat(normal_filename).mode.to_s(8), File.stat(atomic_filename).mode.to_s(8)
|
428
|
+
ensure
|
429
|
+
File.unlink(atomic_filename) rescue nil
|
430
|
+
File.unlink(normal_filename) rescue nil
|
431
|
+
end
|
432
|
+
|
433
|
+
def test_atomic_writes_respect_umask
|
434
|
+
atomic_filename = File.join(Dir.tmpdir, "test_atomic_perms.atomic")
|
435
|
+
atomic_create_and_write_file(atomic_filename) do |f|
|
436
|
+
f.write("whatever\n")
|
437
|
+
end
|
438
|
+
assert_equal 0, File.stat(atomic_filename).mode & File.umask
|
439
|
+
ensure
|
440
|
+
File.unlink(atomic_filename)
|
441
|
+
end
|
442
|
+
|
422
443
|
class FakeError < RuntimeError; end
|
423
444
|
|
424
445
|
def test_atomic_writes_handles_exceptions
|
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.4
|
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-03-
|
13
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yard
|