sass-embedded 1.89.1 → 1.90.0
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/ext/sass/Rakefile +21 -56
- data/ext/sass/package.json +1 -1
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/value/color/gamut_map_method/local_minde.rb +2 -2
- data/lib/sass/value/color/space/lab.rb +1 -1
- data/lib/sass/value/color/space/srgb.rb +2 -2
- data/lib/sass/value/color/space/utils.rb +1 -1
- data/lib/sass/value/color.rb +20 -20
- data/lib/sass/value/fuzzy_math.rb +13 -13
- data/lib/sass/value/null.rb +1 -1
- data/lib/sass/value/number.rb +3 -3
- data/lib/sass/value.rb +1 -1
- metadata +4 -5
- data/ext/sass/expand-archive.ps1 +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e00ec9ef4aaf921daad6c5c17469d6bc840fced53dd5aecdc100eb3ebf5fe6eb
|
4
|
+
data.tar.gz: 804488b84ae0a8edfcda048aa8742e2fd27103e7cdbb24f7f0711e66dbccc454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc263de73dccc9732a7d9bfbca69112e5a0aab716eda4a69ce845f1b7e6ab4aa5ff563cb7caa60141e5ee1df69dec9ea4800b4a2ca11ce6b3e74fa87b0ef5ec
|
7
|
+
data.tar.gz: 7b7f06c15ebd95bc772f6ded3bf96f8b67d9e41af2d9830a11e143b5ba191f1e0f62ea7bb82621726c928768258becafb724496401731a3e46a497457d6937cf
|
data/ext/sass/Rakefile
CHANGED
@@ -288,64 +288,14 @@ end
|
|
288
288
|
# This is a FileUtils extension that defines several additional commands to be
|
289
289
|
# added to the FileUtils utility functions.
|
290
290
|
module FileUtils
|
291
|
-
# PowerShell quirks:
|
292
|
-
# - `powershell -Command -`:
|
293
|
-
# Arguments must be part of command, thus cannot pass arguments safely without escaping.
|
294
|
-
# - `powershell -Command <script-block> [-args <arg-array>]`:
|
295
|
-
# This only works when invoking powershell subshell in powershell.
|
296
|
-
# - `powershell -Command <string> [<CommandParameters>]`:
|
297
|
-
# CommandParameters are joined with command and then parsed, thus cannot pass arguments safely without escaping.
|
298
|
-
# - `powershell -File -`:
|
299
|
-
# Arguments must be part of file, thus cannot pass arguments safely without escaping.
|
300
|
-
# - `powershell -File <filePath> <args>`:
|
301
|
-
# This is the only way to pass arguments safely without escaping.
|
302
|
-
def powershell(file, *args)
|
303
|
-
sh 'powershell', '-NoLogo', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', file, *args
|
304
|
-
end
|
305
|
-
|
306
|
-
def junzip(archive, dest = '.')
|
307
|
-
require 'java'
|
308
|
-
|
309
|
-
Rake.rake_output_message "Archive: #{archive}" if Rake::FileUtilsExt.verbose_flag
|
310
|
-
|
311
|
-
current_directory = java.nio.file.Paths.get(org.jruby.Ruby.getGlobalRuntime.getCurrentDirectory)
|
312
|
-
zip_file = java.util.zip.ZipFile.new(current_directory.resolve(archive).toFile)
|
313
|
-
dest_path = current_directory.resolve(dest).normalize
|
314
|
-
entries = zip_file.entries
|
315
|
-
while entries.hasMoreElements
|
316
|
-
entry = entries.nextElement
|
317
|
-
name = entry.getName
|
318
|
-
path = dest_path.resolve(name).normalize
|
319
|
-
raise SecurityError unless path.startsWith(dest_path)
|
320
|
-
|
321
|
-
Rake.rake_output_message " inflating: #{name}" if Rake::FileUtilsExt.verbose_flag
|
322
|
-
|
323
|
-
if entry.isDirectory
|
324
|
-
java.nio.file.Files.createDirectories(path)
|
325
|
-
else
|
326
|
-
java.nio.file.Files.createDirectories(path.getParent)
|
327
|
-
java.nio.file.Files.copy(zip_file.getInputStream(entry), path)
|
328
|
-
end
|
329
|
-
end
|
330
|
-
ensure
|
331
|
-
zip_file&.close
|
332
|
-
end
|
333
|
-
|
334
291
|
def unarchive(archive, dest = '.')
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
if RUBY_PLATFORM == 'java'
|
341
|
-
junzip archive, dest
|
342
|
-
elsif Gem.win_platform?
|
343
|
-
powershell 'expand-archive.ps1', '-Force', '-LiteralPath', archive, '-DestinationPath', dest
|
344
|
-
else
|
345
|
-
sh 'unzip', '-od', dest, archive
|
346
|
-
end
|
292
|
+
mkdir_p dest
|
293
|
+
if Gem.win_platform?
|
294
|
+
sh File.absolute_path('tar.exe', SassConfig.windows_get_folder_path(:System)), '-vxC', dest, '-f', archive
|
295
|
+
elsif archive.downcase.end_with?('.zip')
|
296
|
+
sh 'unzip', '-od', dest, archive
|
347
297
|
else
|
348
|
-
|
298
|
+
sh 'tar', '-vxC', dest, '-f', archive, '--no-same-owner', '--no-same-permissions'
|
349
299
|
end
|
350
300
|
end
|
351
301
|
|
@@ -743,4 +693,19 @@ module SassConfig
|
|
743
693
|
platform
|
744
694
|
end
|
745
695
|
end
|
696
|
+
|
697
|
+
def windows_get_folder_path(folder)
|
698
|
+
require 'open3'
|
699
|
+
|
700
|
+
stdout, stderr, status = Open3.capture3('powershell.exe',
|
701
|
+
'-NoLogo',
|
702
|
+
'-NoProfile',
|
703
|
+
'-NonInteractive',
|
704
|
+
'-Command',
|
705
|
+
"[Environment]::GetFolderPath('#{folder}') | Write-Host -NoNewline")
|
706
|
+
|
707
|
+
raise stderr unless status.success?
|
708
|
+
|
709
|
+
File.absolute_path(stdout)
|
710
|
+
end
|
746
711
|
end
|
data/ext/sass/package.json
CHANGED
@@ -28,7 +28,7 @@ module Sass
|
|
28
28
|
hue = original_oklch.send(:channel2_or_nil)
|
29
29
|
alpha = original_oklch.send(:alpha_or_nil)
|
30
30
|
|
31
|
-
if FuzzyMath.greater_than_or_equals(lightness.nil? ? 0 : lightness, 1)
|
31
|
+
if FuzzyMath.greater_than_or_equals?(lightness.nil? ? 0 : lightness, 1)
|
32
32
|
if color.legacy?
|
33
33
|
return Color.send(:_for_space,
|
34
34
|
Space::RGB, 255, 255, 255, color.send(:alpha_or_nil))
|
@@ -37,7 +37,7 @@ module Sass
|
|
37
37
|
return Color.send(:for_space_internal,
|
38
38
|
color.send(:_space), 1, 1, 1, color.send(:alpha_or_nil))
|
39
39
|
end
|
40
|
-
elsif FuzzyMath.less_than_or_equals(lightness.nil? ? 0 : lightness, 0)
|
40
|
+
elsif FuzzyMath.less_than_or_equals?(lightness.nil? ? 0 : lightness, 0)
|
41
41
|
return Color.send(:_for_space,
|
42
42
|
Space::RGB, 0, 0, 0, color.send(:alpha_or_nil))
|
43
43
|
.send(:_to_space, color.send(:_space))
|
@@ -55,7 +55,7 @@ module Sass
|
|
55
55
|
Color.send(
|
56
56
|
:for_space_internal,
|
57
57
|
dest,
|
58
|
-
missing_hue || FuzzyMath.equals(saturation, 0) ? nil : hue % 360,
|
58
|
+
missing_hue || FuzzyMath.equals?(saturation, 0) ? nil : hue % 360,
|
59
59
|
missing_chroma ? nil : saturation,
|
60
60
|
missing_lightness ? nil : lightness * 100,
|
61
61
|
alpha
|
@@ -67,7 +67,7 @@ module Sass
|
|
67
67
|
Color.send(
|
68
68
|
:for_space_internal,
|
69
69
|
dest,
|
70
|
-
missing_hue || FuzzyMath.greater_than_or_equals(whiteness + blackness, 100) ? nil : hue % 360,
|
70
|
+
missing_hue || FuzzyMath.greater_than_or_equals?(whiteness + blackness, 100) ? nil : hue % 360,
|
71
71
|
whiteness,
|
72
72
|
blackness,
|
73
73
|
alpha
|
@@ -62,7 +62,7 @@ module Sass
|
|
62
62
|
def lab_to_lch(dest, lightness, a, b, alpha, # rubocop:disable Naming/MethodParameterName
|
63
63
|
missing_chroma: false, missing_hue: false)
|
64
64
|
chroma = Math.sqrt(((a.nil? ? 0 : a)**2) + ((b.nil? ? 0 : b)**2))
|
65
|
-
hue = if missing_hue || FuzzyMath.equals(chroma, 0)
|
65
|
+
hue = if missing_hue || FuzzyMath.equals?(chroma, 0)
|
66
66
|
nil
|
67
67
|
else
|
68
68
|
Math.atan2(b.nil? ? 0 : b, a.nil? ? 0 : a) * 180 / Math::PI
|
data/lib/sass/value/color.rb
CHANGED
@@ -318,21 +318,21 @@ module Sass
|
|
318
318
|
|
319
319
|
if legacy?
|
320
320
|
return false unless other.legacy?
|
321
|
-
return false unless FuzzyMath.equals_nilable(other.alpha_or_nil, alpha_or_nil)
|
321
|
+
return false unless FuzzyMath.equals_nilable?(other.alpha_or_nil, alpha_or_nil)
|
322
322
|
|
323
323
|
if _space == other._space
|
324
|
-
FuzzyMath.equals_nilable(other.channel0_or_nil, channel0_or_nil) &&
|
325
|
-
FuzzyMath.equals_nilable(other.channel1_or_nil, channel1_or_nil) &&
|
326
|
-
FuzzyMath.equals_nilable(other.channel2_or_nil, channel2_or_nil)
|
324
|
+
FuzzyMath.equals_nilable?(other.channel0_or_nil, channel0_or_nil) &&
|
325
|
+
FuzzyMath.equals_nilable?(other.channel1_or_nil, channel1_or_nil) &&
|
326
|
+
FuzzyMath.equals_nilable?(other.channel2_or_nil, channel2_or_nil)
|
327
327
|
else
|
328
328
|
_to_space(Space::RGB) == other._to_space(Space::RGB)
|
329
329
|
end
|
330
330
|
else
|
331
331
|
other._space == _space &&
|
332
|
-
FuzzyMath.equals_nilable(other.channel0_or_nil, channel0_or_nil) &&
|
333
|
-
FuzzyMath.equals_nilable(other.channel1_or_nil, channel1_or_nil) &&
|
334
|
-
FuzzyMath.equals_nilable(other.channel2_or_nil, channel2_or_nil) &&
|
335
|
-
FuzzyMath.equals_nilable(other.alpha_or_nil, alpha_or_nil)
|
332
|
+
FuzzyMath.equals_nilable?(other.channel0_or_nil, channel0_or_nil) &&
|
333
|
+
FuzzyMath.equals_nilable?(other.channel1_or_nil, channel1_or_nil) &&
|
334
|
+
FuzzyMath.equals_nilable?(other.channel2_or_nil, channel2_or_nil) &&
|
335
|
+
FuzzyMath.equals_nilable?(other.alpha_or_nil, alpha_or_nil)
|
336
336
|
end
|
337
337
|
end
|
338
338
|
|
@@ -367,9 +367,9 @@ module Sass
|
|
367
367
|
def channel0_powerless?
|
368
368
|
case _space
|
369
369
|
when Space::HSL
|
370
|
-
FuzzyMath.equals(channel1, 0)
|
370
|
+
FuzzyMath.equals?(channel1, 0)
|
371
371
|
when Space::HWB
|
372
|
-
FuzzyMath.greater_than_or_equals(channel1 + channel2, 100)
|
372
|
+
FuzzyMath.greater_than_or_equals?(channel1 + channel2, 100)
|
373
373
|
else
|
374
374
|
false
|
375
375
|
end
|
@@ -398,7 +398,7 @@ module Sass
|
|
398
398
|
def channel2_powerless?
|
399
399
|
case _space
|
400
400
|
when Space::LCH, Space::OKLCH
|
401
|
-
FuzzyMath.equals(channel1, 0)
|
401
|
+
FuzzyMath.equals?(channel1, 0)
|
402
402
|
else
|
403
403
|
false
|
404
404
|
end
|
@@ -421,9 +421,9 @@ module Sass
|
|
421
421
|
def _in_gamut?
|
422
422
|
return true unless _space.bounded?
|
423
423
|
|
424
|
-
_is_channel_in_gamut(channel0, _space.channels[0]) &&
|
425
|
-
_is_channel_in_gamut(channel1, _space.channels[1]) &&
|
426
|
-
_is_channel_in_gamut(channel2, _space.channels[2])
|
424
|
+
_is_channel_in_gamut?(channel0, _space.channels[0]) &&
|
425
|
+
_is_channel_in_gamut?(channel1, _space.channels[1]) &&
|
426
|
+
_is_channel_in_gamut?(channel2, _space.channels[2])
|
427
427
|
end
|
428
428
|
|
429
429
|
def _to_gamut(method)
|
@@ -449,7 +449,7 @@ module Sass
|
|
449
449
|
when Space::HSL
|
450
450
|
_initialize_for_space(
|
451
451
|
space,
|
452
|
-
_normalize_hue(channel0, invert: !channel1.nil? && FuzzyMath.less_than(channel1, 0)),
|
452
|
+
_normalize_hue(channel0, invert: !channel1.nil? && FuzzyMath.less_than?(channel1, 0)),
|
453
453
|
channel1&.abs,
|
454
454
|
channel2,
|
455
455
|
alpha
|
@@ -461,7 +461,7 @@ module Sass
|
|
461
461
|
space,
|
462
462
|
channel0,
|
463
463
|
channel1&.abs,
|
464
|
-
_normalize_hue(channel2, invert: !channel1.nil? && FuzzyMath.less_than(channel1, 0)),
|
464
|
+
_normalize_hue(channel2, invert: !channel1.nil? && FuzzyMath.less_than?(channel1, 0)),
|
465
465
|
alpha
|
466
466
|
)
|
467
467
|
else
|
@@ -485,10 +485,10 @@ module Sass
|
|
485
485
|
((hue % 360) + 360 + (invert ? 180 : 0)) % 360
|
486
486
|
end
|
487
487
|
|
488
|
-
def _is_channel_in_gamut(value, channel)
|
488
|
+
def _is_channel_in_gamut?(value, channel)
|
489
489
|
case channel
|
490
490
|
when LinearChannel
|
491
|
-
FuzzyMath.less_than_or_equals(value, channel.max) && FuzzyMath.greater_than_or_equals(value, channel.min)
|
491
|
+
FuzzyMath.less_than_or_equals?(value, channel.max) && FuzzyMath.greater_than_or_equals?(value, channel.min)
|
492
492
|
else
|
493
493
|
true
|
494
494
|
end
|
@@ -500,8 +500,8 @@ module Sass
|
|
500
500
|
raise Sass::ScriptError.new("Expected #{wieght} to be within 0 and 1.", 'weight')
|
501
501
|
end
|
502
502
|
|
503
|
-
return other if FuzzyMath.equals(weight, 0)
|
504
|
-
return self if FuzzyMath.equals(weight, 1)
|
503
|
+
return other if FuzzyMath.equals?(weight, 0)
|
504
|
+
return self if FuzzyMath.equals?(weight, 1)
|
505
505
|
|
506
506
|
color1 = _to_space(method.space)
|
507
507
|
color2 = other._to_space(method.space)
|
@@ -12,7 +12,7 @@ module Sass
|
|
12
12
|
|
13
13
|
module_function
|
14
14
|
|
15
|
-
def equals(number1, number2)
|
15
|
+
def equals?(number1, number2)
|
16
16
|
return true if number1 == number2
|
17
17
|
|
18
18
|
(number1 - number2).abs <= EPSILON &&
|
@@ -20,7 +20,7 @@ module Sass
|
|
20
20
|
(number2 * INVERSE_EPSILON).round
|
21
21
|
end
|
22
22
|
|
23
|
-
def equals_nilable(number1, number2)
|
23
|
+
def equals_nilable?(number1, number2)
|
24
24
|
return true if number1 == number2
|
25
25
|
return false if number1.nil? || number2.nil?
|
26
26
|
|
@@ -29,26 +29,26 @@ module Sass
|
|
29
29
|
(number2 * INVERSE_EPSILON).round
|
30
30
|
end
|
31
31
|
|
32
|
-
def less_than(number1, number2)
|
33
|
-
number1 < number2 && !equals(number1, number2)
|
32
|
+
def less_than?(number1, number2)
|
33
|
+
number1 < number2 && !equals?(number1, number2)
|
34
34
|
end
|
35
35
|
|
36
|
-
def less_than_or_equals(number1, number2)
|
37
|
-
number1 < number2 || equals(number1, number2)
|
36
|
+
def less_than_or_equals?(number1, number2)
|
37
|
+
number1 < number2 || equals?(number1, number2)
|
38
38
|
end
|
39
39
|
|
40
|
-
def greater_than(number1, number2)
|
41
|
-
number1 > number2 && !equals(number1, number2)
|
40
|
+
def greater_than?(number1, number2)
|
41
|
+
number1 > number2 && !equals?(number1, number2)
|
42
42
|
end
|
43
43
|
|
44
|
-
def greater_than_or_equals(number1, number2)
|
45
|
-
number1 > number2 || equals(number1, number2)
|
44
|
+
def greater_than_or_equals?(number1, number2)
|
45
|
+
number1 > number2 || equals?(number1, number2)
|
46
46
|
end
|
47
47
|
|
48
48
|
def integer?(number)
|
49
49
|
return false unless number.finite?
|
50
50
|
|
51
|
-
equals(number, number.round)
|
51
|
+
equals?(number, number.round)
|
52
52
|
end
|
53
53
|
|
54
54
|
def to_i(number)
|
@@ -56,8 +56,8 @@ module Sass
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def between(number, min, max)
|
59
|
-
return min if equals(number, min)
|
60
|
-
return max if equals(number, max)
|
59
|
+
return min if equals?(number, min)
|
60
|
+
return max if equals?(number, max)
|
61
61
|
return number if number > min && number < max
|
62
62
|
|
63
63
|
nil
|
data/lib/sass/value/null.rb
CHANGED
data/lib/sass/value/number.rb
CHANGED
@@ -80,14 +80,14 @@ module Sass
|
|
80
80
|
return false if numerator_units.length != other.numerator_units.length ||
|
81
81
|
denominator_units.length != other.denominator_units.length
|
82
82
|
|
83
|
-
return FuzzyMath.equals(value, other.value) if unitless?
|
83
|
+
return FuzzyMath.equals?(value, other.value) if unitless?
|
84
84
|
|
85
85
|
if Unit.canonicalize_units(numerator_units) != Unit.canonicalize_units(other.numerator_units) &&
|
86
86
|
Unit.canonicalize_units(denominator_units) != Unit.canonicalize_units(other.denominator_units)
|
87
87
|
return false
|
88
88
|
end
|
89
89
|
|
90
|
-
FuzzyMath.equals(
|
90
|
+
FuzzyMath.equals?(
|
91
91
|
value *
|
92
92
|
Unit.canonical_multiplier(numerator_units) /
|
93
93
|
Unit.canonical_multiplier(denominator_units),
|
@@ -306,7 +306,7 @@ module Sass
|
|
306
306
|
|
307
307
|
unit_length = new_numerator_units.length + new_denominator_units.length
|
308
308
|
units = unit_string(new_numerator_units, new_denominator_units)
|
309
|
-
Sass::ScriptError.new("Expected #{self} to have unit#{unit_length > 1
|
309
|
+
Sass::ScriptError.new("Expected #{self} to have unit#{'s' if unit_length > 1} #{units}", name)
|
310
310
|
}
|
311
311
|
|
312
312
|
result = value
|
data/lib/sass/value.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-embedded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.90.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
@@ -52,7 +52,6 @@ files:
|
|
52
52
|
- exe/sass
|
53
53
|
- ext/sass/Rakefile
|
54
54
|
- ext/sass/embedded_sass_pb.rb
|
55
|
-
- ext/sass/expand-archive.ps1
|
56
55
|
- ext/sass/package.json
|
57
56
|
- lib/sass-embedded.rb
|
58
57
|
- lib/sass/calculation_value.rb
|
@@ -124,8 +123,8 @@ licenses:
|
|
124
123
|
- MIT
|
125
124
|
metadata:
|
126
125
|
bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
|
127
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.
|
128
|
-
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.
|
126
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.90.0
|
127
|
+
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.90.0
|
129
128
|
funding_uri: https://github.com/sponsors/ntkme
|
130
129
|
rubygems_mfa_required: 'true'
|
131
130
|
rdoc_options: []
|
@@ -142,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
141
|
- !ruby/object:Gem::Version
|
143
142
|
version: '0'
|
144
143
|
requirements: []
|
145
|
-
rubygems_version: 3.
|
144
|
+
rubygems_version: 3.7.1
|
146
145
|
specification_version: 4
|
147
146
|
summary: Use dart-sass with Ruby!
|
148
147
|
test_files: []
|
data/ext/sass/expand-archive.ps1
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Expand-Archive @args
|