sass 3.5.3 → 3.5.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: 0a9a7e7eaf523795eb1a4d5b7975591340f6ee4f
4
- data.tar.gz: 1ed58578bc0436fc6fec5388d26d6494aee867df
3
+ metadata.gz: 3d6db5ce098f0328d6c4bbdc436d7cf4e94c9096
4
+ data.tar.gz: b74613eccfd8ab1e55c14459cc200612e279c159
5
5
  SHA512:
6
- metadata.gz: 2ea7239c454041a2370b7927f1d86face3e1cbabf6ad30a51afb1d3546e2c405ecd5bab125c0d4d90890f799bee2c89da6865f32ce931fc26a78cc6103396302
7
- data.tar.gz: 6adf204bdf107345eca19827602b4749e9bcf02656206aafb825f70db012c49934ac881e43eab2b0af250d46310b6d21b271e5d886a0abd071a3d031e1b69820
6
+ metadata.gz: 307d709f4c989a5648693d75844d18baad5b87d866b411c290b1a8d78752e40f4843f915c2d0b674d5774eb8610cfa33c52b81fbf7ab9a9159e011108c24d2dd
7
+ data.tar.gz: a867777fc30aadbf4ca30166deedb359ebae82f41594d5884cd33609ca4ec121b53a33d4c60b47eb0e4cd53da94e63f552d69b178d840d3499a4c2265f2ba61a
data/Rakefile CHANGED
@@ -264,6 +264,46 @@ begin
264
264
  OPTS
265
265
  Rake::Task['yard'].execute
266
266
  end
267
+
268
+ # Add IDs to the reference to match the old IDs generated by Maruku. This
269
+ # ensures that old anchored links continue to work.
270
+ task :add_ids do
271
+ require 'nokogiri'
272
+
273
+ doc = Nokogiri::HTML(File.read('doc/file.SASS_REFERENCE.html'))
274
+
275
+ doc.css("#filecontents").css("h1, h2, h3, h4, h5, h6").each do |h|
276
+ next if h.inner_text.empty?
277
+ h['id'] =
278
+ case h.inner_text
279
+ when "Referencing Parent Selectors: &"; "parent-selector"
280
+ when /^Comments:/; "comments"
281
+ when "Strings"; "sass-script-strings"
282
+ when "Division and /"; "division-and-slash"
283
+ when /^Subtraction,/; "subtraction"
284
+ when "& in SassScript"; "parent-script"
285
+ when "@-Rules and Directives"; "directives"
286
+ when "@extend-Only Selectors"; "placeholders"
287
+ when "@extend-Only Selectors"; "placeholders"
288
+ when "@each"; "each-directive"
289
+ when "Multiple Assignment"; "each-multi-assign"
290
+ when "Mixin Directives"; "mixins"
291
+ when /^Defining a Mixin:/; "defining_a_mixin"
292
+ when /^Including a Mixin:/; "including_a_mixin"
293
+ when "Arguments"; "mixin-arguments"
294
+ when "Passing Content Blocks to a Mixin"; "mixin-content"
295
+ else
296
+ h.inner_text.downcase.gsub(/[^a-z _-]/, '').gsub(' ', '_')
297
+ end
298
+ end
299
+
300
+ # Give each option an anchor.
301
+ doc.css("#filecontents li p strong code").each do |c|
302
+ c['id'] = c.inner_text.gsub(/:/, '') + '-option'
303
+ end
304
+
305
+ File.write('doc/file.SASS_REFERENCE.html', doc.to_html)
306
+ end
267
307
  end
268
308
 
269
309
  YARD::Rake::YardocTask.new do |t|
@@ -289,8 +329,8 @@ OPTS
289
329
  Rake::Task['yard'].instance_variable_set('@comment', nil)
290
330
 
291
331
  desc "Generate Documentation"
292
- task :doc => :yard
293
- task :redoc => :yard
332
+ task :doc => [:yard, 'doc:add_ids']
333
+ task :redoc => [:yard, 'doc:add_ids']
294
334
  rescue LoadError
295
335
  desc "Generate Documentation"
296
336
  task :doc => :rdoc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.3
1
+ 3.5.4
@@ -1 +1 @@
1
- 27 October 2017 00:52:01 UTC
1
+ 15 December 2017 23:15:58 UTC
@@ -375,7 +375,7 @@ Error generating source map: couldn't determine public URL for "#{filename}".
375
375
  Without a public URL, there's nothing for the source map to link to.
376
376
  An importer was not set for this file.
377
377
  ERR
378
- elsif Sass::Util.silence_warnings do
378
+ elsif Sass::Util.silence_sass_warnings do
379
379
  sourcemap_dir = nil if @options[:sourcemap] == :file
380
380
  importer.public_url(filename, sourcemap_dir).nil?
381
381
  end
@@ -22,6 +22,17 @@ class Sass::Logger::Base
22
22
  !disabled && self.class.log_level?(level, log_level)
23
23
  end
24
24
 
25
+ # Captures all logger messages emitted during a block and returns them as a
26
+ # string.
27
+ def capture
28
+ old_io = io
29
+ self.io = StringIO.new
30
+ yield
31
+ io.to_s
32
+ ensure
33
+ self.io = old_io
34
+ end
35
+
25
36
  def log(level, message)
26
37
  _log(level, message) if logging_level?(level)
27
38
  end
@@ -139,13 +139,11 @@ module Sass::Tree
139
139
  # We don't use real filename/line info because we don't have it yet.
140
140
  # When we get it, we'll set it on the parsed rules if possible.
141
141
  parser = nil
142
- warnings = Sass::Util.silence_warnings do
142
+ warnings = Sass.logger.capture do
143
143
  parser = Sass::SCSS::StaticParser.new(@rule.join.strip, nil, nil, 1)
144
144
  # rubocop:disable RescueModifier
145
145
  @parsed_rules = parser.parse_selector rescue nil
146
146
  # rubocop:enable RescueModifier
147
-
148
- $stderr.string
149
147
  end
150
148
 
151
149
  # If parsing produces a warning, throw away the result so we can parse
@@ -137,8 +137,13 @@ module Sass
137
137
  def round(value)
138
138
  # If the number is within epsilon of X.5, round up (or down for negative
139
139
  # numbers).
140
- return value.round if (value % 1) - 0.5 <= -1 * Script::Value::Number.epsilon
141
- value > 0 ? value.ceil : value.floor
140
+ mod = value % 1
141
+ mod_is_half = (mod - 0.5).abs < Script::Value::Number.epsilon
142
+ if value > 0
143
+ !mod_is_half && mod < 0.5 ? value.floor : value.ceil
144
+ else
145
+ mod_is_half || mod < 0.5 ? value.floor : value.ceil
146
+ end
142
147
  end
143
148
 
144
149
  # Concatenates all strings that are adjacent in an array,
@@ -451,16 +456,6 @@ module Sass
451
456
  Sass::Util.sass_warn full_message
452
457
  end
453
458
 
454
- # Silence all output to STDERR within a block.
455
- #
456
- # @yield A block in which no output will be printed to STDERR
457
- def silence_warnings
458
- the_real_stderr, $stderr = $stderr, StringIO.new
459
- yield
460
- ensure
461
- $stderr = the_real_stderr
462
- end
463
-
464
459
  # Silences all Sass warnings within a block.
465
460
  #
466
461
  # @yield A block in which no Sass warnings will be printed
@@ -994,7 +994,7 @@ SCSS
994
994
 
995
995
  def test_ids
996
996
  assert_equal "#foo", resolve("#foo")
997
- assert_equal "#abcd", resolve("#abcd")
997
+ silence_warnings {assert_equal "#abcd", resolve("#abcd")}
998
998
  assert_equal "#abc-def", resolve("#abc-def")
999
999
  assert_equal "#abc_def", resolve("#abc_def")
1000
1000
  assert_equal "#uvw-xyz", resolve("#uvw-xyz")
@@ -139,16 +139,6 @@ class UtilTest < MiniTest::Test
139
139
  assert(!subsequence?([1, 2, 3], [3, 2, 1]))
140
140
  end
141
141
 
142
- def test_silence_warnings
143
- old_stderr, $stderr = $stderr, StringIO.new
144
- warn "Out"
145
- assert_equal("Out\n", $stderr.string)
146
- silence_warnings {warn "In"}
147
- assert_equal("Out\n", $stderr.string)
148
- ensure
149
- $stderr = old_stderr
150
- end
151
-
152
142
  def test_sass_warn
153
143
  assert_warning("Foo!") {sass_warn "Foo!"}
154
144
  end
@@ -74,7 +74,7 @@ class MiniTest::Test
74
74
  end
75
75
 
76
76
  def silence_warnings(&block)
77
- Sass::Util.silence_warnings(&block)
77
+ Sass::Util.silence_sass_warnings(&block)
78
78
  end
79
79
 
80
80
  def assert_raise_message(klass, message)
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.5.3
4
+ version: 3.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -10,62 +10,76 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-10-27 00:00:00.000000000 Z
13
+ date: 2017-12-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sass-listen
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
21
  version: 4.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - "~>"
26
+ - - ~>
27
27
  - !ruby/object:Gem::Version
28
28
  version: 4.0.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: yard
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ~>
34
34
  - !ruby/object:Gem::Version
35
35
  version: 0.8.7.6
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - "~>"
40
+ - - ~>
41
41
  - !ruby/object:Gem::Version
42
42
  version: 0.8.7.6
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: redcarpet
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - ~>
48
48
  - !ruby/object:Gem::Version
49
- version: 2.3.0
49
+ version: '3.3'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - "~>"
54
+ - - ~>
55
55
  - !ruby/object:Gem::Version
56
- version: 2.3.0
56
+ version: '3.3'
57
+ - !ruby/object:Gem::Dependency
58
+ name: nokogiri
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: 1.6.0
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ version: 1.6.0
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: minitest
59
73
  requirement: !ruby/object:Gem::Requirement
60
74
  requirements:
61
- - - ">="
75
+ - - '>='
62
76
  - !ruby/object:Gem::Version
63
77
  version: '5'
64
78
  type: :development
65
79
  prerelease: false
66
80
  version_requirements: !ruby/object:Gem::Requirement
67
81
  requirements:
68
- - - ">="
82
+ - - '>='
69
83
  - !ruby/object:Gem::Version
70
84
  version: '5'
71
85
  description: |2
@@ -81,7 +95,7 @@ executables:
81
95
  extensions: []
82
96
  extra_rdoc_files: []
83
97
  files:
84
- - ".yardopts"
98
+ - .yardopts
85
99
  - CODE_OF_CONDUCT.md
86
100
  - CONTRIBUTING.md
87
101
  - MIT-LICENSE
@@ -362,12 +376,12 @@ require_paths:
362
376
  - lib
363
377
  required_ruby_version: !ruby/object:Gem::Requirement
364
378
  requirements:
365
- - - ">="
379
+ - - '>='
366
380
  - !ruby/object:Gem::Version
367
381
  version: 2.0.0
368
382
  required_rubygems_version: !ruby/object:Gem::Requirement
369
383
  requirements:
370
- - - ">="
384
+ - - '>='
371
385
  - !ruby/object:Gem::Version
372
386
  version: '0'
373
387
  requirements: []