sass 3.3.3 → 3.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b1f65147a1c8475b358cc3769c042b4e61b3973
4
- data.tar.gz: 8bef79f9df38193e0891505f82f1d523d6229383
3
+ metadata.gz: e01f4f4c3ddb4b26467c0ba857d8472415830997
4
+ data.tar.gz: d0ac7a66e45fba34fe08aff86472371b816a8928
5
5
  SHA512:
6
- metadata.gz: fbb1fa87bbd19535fcf56757318b75946833c85b1bf17caced90dddbad38ae0e6738c0e9b8d5480942f8a0e8a8014f9f40b4814a47fac6312ddc8b361da4b3db
7
- data.tar.gz: 21b79150a581f91e5d92161cb41a85b85ae35ee45e3750034c23a85ae046f6c50d5d8b084eafa68d328588ebcdb2e1253878bbfcb7fa74f9367e5bbc6c190b5a
6
+ metadata.gz: aa0e2df2d14eac32d04038eeb293cc98b60daaf1b0de4d6132c4284c90d212fd7d2c29b5a66c5d13ab33aaf65238bb1b4930f01e7bff04c160c2ac19fa7fa088
7
+ data.tar.gz: c455f23cd577a8b7f5464bfb8eead044184bf2402218bec37fdfd3a7e05cf4e4b564fb69c6c4288ae09b8a3fae1815cb5c85fe98ef1e0c492c910f63df5c1a3f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.3
1
+ 3.3.4
@@ -1 +1 @@
1
- 14 March 2014 23:31:57 UTC
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
- File.unlink path_to(key)
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
- # on windows 'dir' can be in native File::ALT_SEPARATOR form
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 automaticaly go out of scope when a series of staleness
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 dencrease the
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%), 060deg) => hsl(60, 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 occurance of `$substring` in `$string`. If
1415
- # there is no such occurance, returns `null`.
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, 20px)) => 2
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 respresentation of the value as
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)
@@ -20,7 +20,7 @@ module Sass::Script::Value
20
20
  #
21
21
  # @param value [Object] The object for \{#value}
22
22
  def initialize(value = nil)
23
- @value = value.freeze
23
+ @value = value.freeze unless value.nil?
24
24
  end
25
25
 
26
26
  # Sets the options hash for this node,
@@ -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)
@@ -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 seelctor,
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-destrucively extends this selector with the extensions specified in a hash
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 unproccessed Sass `@charset` directive.
2
+ # A static node representing an unprocessed Sass `@charset` directive.
3
3
  #
4
4
  # @see Sass::Tree
5
5
  class CharsetNode < Node
@@ -1,5 +1,5 @@
1
1
  module Sass::Tree
2
- # A static node representing an unproccessed Sass `@`-directive.
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.
@@ -1,7 +1,7 @@
1
1
  require 'sass/tree/node'
2
2
 
3
3
  module Sass::Tree
4
- # A static node reprenting an `@extend` directive.
4
+ # A static node representing an `@extend` directive.
5
5
  #
6
6
  # @see Sass::Tree
7
7
  class ExtendNode < Node
@@ -1,7 +1,7 @@
1
1
  require 'pathname'
2
2
 
3
3
  module Sass::Tree
4
- # A static node reprenting a CSS rule.
4
+ # A static node representing a CSS rule.
5
5
  #
6
6
  # @see Sass::Tree
7
7
  class RuleNode < Node
@@ -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
- @parent = parent unless is_any_of?(parent, SCRIPT_NODES) ||
27
- (parent.bubbles? && !old_parent.is_a?(Sass::Tree::RootNode))
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
@@ -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
@@ -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 assocations in the map.
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
  #
@@ -18,7 +18,7 @@ class CompilerTest < Test::Unit::TestCase
18
18
  @start_called = false
19
19
  reset_events!
20
20
  end
21
-
21
+
22
22
  def fire_events!(*args)
23
23
  @on_filesystem_event.call(@modified, @added, @removed)
24
24
  reset_events!
@@ -62,7 +62,7 @@ div .debug
62
62
  SASS
63
63
  div .warning {
64
64
  color: #d21a19; }
65
- span .debug {
65
+ span .debug {
66
66
  cursor: crosshair;}
67
67
  div .debug {
68
68
  cursor: default; }
@@ -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
@@ -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)"
@@ -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
 
@@ -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
  }
@@ -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.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-14 00:00:00.000000000 Z
13
+ date: 2014-03-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yard