sass-embedded 1.89.2 → 1.91.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 +58 -116
- data/ext/sass/package.json +1 -1
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/value/color.rb +4 -4
- 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: b86edb0f5fc64eaed25b369b4d4a2fa596255f8d41a21109f3a83fcfebd528a1
|
4
|
+
data.tar.gz: 3059faf9da290fe6a1ca108820190d378d4c9ef5973a8da53e9fe1e03a58c951
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b04d824ffcd30038cf6409f3f235725ca3db972d9e1226cc4cc7fda17debc891ed5d3bdeb9bbe546cc080e758ec94a49b4fdb8c33fc5c7444178ce6241c6214a
|
7
|
+
data.tar.gz: e9a20af1c74c4595afebaa176dc4bae0a5dcfaed5ba77237af5f530ff3f53ac8a84913810ae15cc2d64d525b6c9d1a0eb4bd9c51b7eab4c22e630a0e5395e388
|
data/ext/sass/Rakefile
CHANGED
@@ -209,17 +209,6 @@ file 'true' do |t|
|
|
209
209
|
# 40007a: b8 3c 00 00 00 movl $0x3c, %eax
|
210
210
|
# 40007f: 0f 05 syscall
|
211
211
|
entry_point = %w[31ffb83c0000000f05].pack('H*')
|
212
|
-
when 'i386'
|
213
|
-
ei_class = ELF::ELFCLASS32
|
214
|
-
ei_data = ELF::ELFDATA2LSB
|
215
|
-
e_machine = 0x03
|
216
|
-
e_flags = 0
|
217
|
-
|
218
|
-
# 00400054 <PT_LOAD#0>:
|
219
|
-
# 400054: 31 db xorl %ebx, %ebx
|
220
|
-
# 400056: b8 01 00 00 00 movl $0x1, %eax
|
221
|
-
# 40005b: cd 80 int $0x80
|
222
|
-
entry_point = %w[31dbb801000000cd80].pack('H*')
|
223
212
|
else
|
224
213
|
raise NotImplementedError
|
225
214
|
end
|
@@ -288,99 +277,23 @@ end
|
|
288
277
|
# This is a FileUtils extension that defines several additional commands to be
|
289
278
|
# added to the FileUtils utility functions.
|
290
279
|
module FileUtils
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
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
|
-
def unarchive(archive, dest = '.')
|
335
|
-
case archive.downcase
|
336
|
-
when ->(name) { name.include?('.tar.') || name.end_with?('.tar') }
|
337
|
-
mkdir_p dest
|
338
|
-
sh 'tar', '-vxC', dest, '-f', archive, '--no-same-owner', '--no-same-permissions'
|
339
|
-
when ->(name) { name.end_with?('.zip') }
|
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
|
280
|
+
def unarchive(archive)
|
281
|
+
if Gem.win_platform?
|
282
|
+
sh File.absolute_path('tar.exe', Utils.windows_system_directory), '-vxf', archive
|
283
|
+
elsif archive.downcase.end_with?('.zip')
|
284
|
+
sh 'unzip', '-o', archive
|
347
285
|
else
|
348
|
-
|
286
|
+
sh 'tar', '-vxf', archive, '--no-same-owner', '--no-same-permissions'
|
349
287
|
end
|
350
288
|
end
|
351
289
|
|
352
290
|
def fetch(source_uri, dest_path = nil)
|
353
|
-
|
354
|
-
|
355
|
-
source_uri = "/#{source_uri}" if !source_uri.start_with?('/') && File.absolute_path?(source_uri)
|
356
|
-
|
357
|
-
source_uri = begin
|
358
|
-
Gem::Uri.parse!(source_uri)
|
359
|
-
rescue NoMethodError
|
360
|
-
begin
|
361
|
-
URI.parse(source_uri)
|
362
|
-
rescue StandardError
|
363
|
-
URI.parse(URI::DEFAULT_PARSER.escape(source_uri.to_s))
|
364
|
-
end
|
365
|
-
end
|
366
|
-
|
367
|
-
scheme = source_uri.scheme
|
368
|
-
source_path = begin
|
369
|
-
Gem::URI::DEFAULT_PARSER
|
370
|
-
rescue NameError
|
371
|
-
URI::DEFAULT_PARSER
|
372
|
-
end.unescape(source_uri.path)
|
291
|
+
dest_path = File.basename(source_uri) if dest_path.nil?
|
373
292
|
|
374
|
-
|
375
|
-
|
376
|
-
fetcher = Gem::RemoteFetcher.fetcher
|
377
|
-
symbol = :"fetch_#{scheme.nil? ? 'file' : scheme}"
|
378
|
-
raise ArgumentError, "Unsupported URI scheme #{scheme}" unless fetcher.respond_to?(symbol)
|
379
|
-
|
380
|
-
Rake.rake_output_message "fetch #{Gem::Uri.new(source_uri).redacted}" if Rake::FileUtilsExt.verbose_flag
|
293
|
+
Rake.rake_output_message "fetch #{source_uri}" if Rake::FileUtilsExt.verbose_flag
|
381
294
|
|
382
295
|
unless Rake::FileUtilsExt.nowrite_flag
|
383
|
-
data =
|
296
|
+
data = Utils.fetch_https(source_uri)
|
384
297
|
Gem.write_binary(dest_path, data)
|
385
298
|
end
|
386
299
|
|
@@ -464,9 +377,7 @@ module Platform
|
|
464
377
|
(Platform::CPU == 'riscv64' &&
|
465
378
|
File.exist?(File.absolute_path('lib/ld-linux-riscv64-lp64d.so.1', root))) ||
|
466
379
|
(Platform::CPU == 'x86_64' &&
|
467
|
-
File.exist?(File.absolute_path('lib64/ld-linux-x86-64.so.2', root)))
|
468
|
-
(Platform::CPU == 'i386' &&
|
469
|
-
File.exist?(File.absolute_path('lib/ld-linux.so.2', root)))
|
380
|
+
File.exist?(File.absolute_path('lib64/ld-linux-x86-64.so.2', root)))
|
470
381
|
return 'linux-gnu'
|
471
382
|
end
|
472
383
|
|
@@ -475,7 +386,7 @@ module Platform
|
|
475
386
|
return 'linux-gnueabihf'
|
476
387
|
end
|
477
388
|
|
478
|
-
if %w[aarch64 riscv64 x86_64
|
389
|
+
if %w[aarch64 riscv64 x86_64].include?(Platform::CPU) &&
|
479
390
|
File.exist?(File.absolute_path("lib/ld-musl-#{Platform::CPU}.so.1", root))
|
480
391
|
return 'linux-musl'
|
481
392
|
end
|
@@ -485,10 +396,8 @@ module Platform
|
|
485
396
|
return 'linux-musleabihf'
|
486
397
|
end
|
487
398
|
|
488
|
-
if
|
489
|
-
|
490
|
-
(Platform::CPU == 'i386' &&
|
491
|
-
File.exist?(File.absolute_path('system/bin/linker', root)))
|
399
|
+
if %w[aarch64 riscv64 x86_64].include?(Platform::CPU) &&
|
400
|
+
File.exist?(File.absolute_path('system/bin/linker64', root))
|
492
401
|
return 'linux-android'
|
493
402
|
end
|
494
403
|
|
@@ -625,8 +534,6 @@ module SassConfig
|
|
625
534
|
end
|
626
535
|
|
627
536
|
def protoc
|
628
|
-
require 'rubygems/remote_fetcher'
|
629
|
-
|
630
537
|
repo = 'https://repo.maven.apache.org/maven2/com/google/protobuf/protoc'
|
631
538
|
|
632
539
|
dependency = Gem::Dependency.new('google-protobuf')
|
@@ -665,7 +572,7 @@ module SassConfig
|
|
665
572
|
|
666
573
|
uri = "#{repo}/#{version}/protoc-#{version}-#{os}-#{cpu}.exe"
|
667
574
|
|
668
|
-
|
575
|
+
Utils.fetch_https("#{uri}.sha1")
|
669
576
|
|
670
577
|
uri
|
671
578
|
rescue Gem::RemoteFetcher::FetchError
|
@@ -678,7 +585,7 @@ module SassConfig
|
|
678
585
|
versions.sort.reverse_each do |v|
|
679
586
|
uri = "#{repo}/#{v}/protoc-#{v}-#{os}-#{cpu}.exe"
|
680
587
|
|
681
|
-
|
588
|
+
Utils.fetch_https("#{uri}.sha1")
|
682
589
|
|
683
590
|
return uri
|
684
591
|
rescue Gem::RemoteFetcher::FetchError
|
@@ -690,16 +597,13 @@ module SassConfig
|
|
690
597
|
|
691
598
|
def embedded_sass_protocol
|
692
599
|
require 'json'
|
693
|
-
require 'open3'
|
694
|
-
|
695
|
-
stdout, stderr, status = Open3.capture3(RbConfig.ruby,
|
696
|
-
File.absolute_path('../../exe/sass', __dir__),
|
697
|
-
'--embedded',
|
698
|
-
'--version')
|
699
600
|
|
700
|
-
|
601
|
+
version = Utils.capture(RbConfig.ruby,
|
602
|
+
File.absolute_path('../../exe/sass', __dir__),
|
603
|
+
'--embedded',
|
604
|
+
'--version')
|
701
605
|
|
702
|
-
tag_name = JSON.parse(
|
606
|
+
tag_name = JSON.parse(version)['protocolVersion']
|
703
607
|
|
704
608
|
"https://github.com/sass/sass/raw/embedded-protocol-#{tag_name}/spec/embedded_sass.proto"
|
705
609
|
rescue StandardError # TODO: remove after https://github.com/sass/dart-sass/pull/2413
|
@@ -744,3 +648,41 @@ module SassConfig
|
|
744
648
|
end
|
745
649
|
end
|
746
650
|
end
|
651
|
+
|
652
|
+
# The {Utils} module.
|
653
|
+
module Utils
|
654
|
+
module_function
|
655
|
+
|
656
|
+
def capture(...)
|
657
|
+
require 'open3'
|
658
|
+
|
659
|
+
stdout, stderr, status = Open3.capture3(...)
|
660
|
+
|
661
|
+
raise stderr unless status.success?
|
662
|
+
|
663
|
+
stdout
|
664
|
+
end
|
665
|
+
|
666
|
+
def fetch_https(source_uri)
|
667
|
+
require 'rubygems/remote_fetcher'
|
668
|
+
|
669
|
+
source_uri = begin
|
670
|
+
Gem::Uri.parse!(source_uri)
|
671
|
+
rescue NoMethodError
|
672
|
+
URI.parse(source_uri)
|
673
|
+
end
|
674
|
+
|
675
|
+
Gem::RemoteFetcher.fetcher.fetch_https(source_uri)
|
676
|
+
end
|
677
|
+
|
678
|
+
def windows_system_directory
|
679
|
+
path = capture('powershell.exe',
|
680
|
+
'-NoLogo',
|
681
|
+
'-NoProfile',
|
682
|
+
'-NonInteractive',
|
683
|
+
'-Command',
|
684
|
+
'[Environment]::GetFolderPath([Environment+SpecialFolder]::System) | Write-Host -NoNewline')
|
685
|
+
|
686
|
+
File.absolute_path(path)
|
687
|
+
end
|
688
|
+
end
|
data/ext/sass/package.json
CHANGED
data/lib/sass/value/color.rb
CHANGED
@@ -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)
|
@@ -485,7 +485,7 @@ 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
491
|
FuzzyMath.less_than_or_equals?(value, channel.max) && FuzzyMath.greater_than_or_equals?(value, channel.min)
|
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.91.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.91.0
|
127
|
+
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.91.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
|