sass-embedded 1.97.2 → 1.97.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f8c67967dcd0ffd3183eadf5e482721ed2c35b12987497c475d4a41c25218c9
4
- data.tar.gz: 4aba477d727272315f9b69379f5038d8ef5aa75c1fcd2de284966fecdf225444
3
+ metadata.gz: 69ad28409fe8586fa06a9ffe3d02d412d358d650c2a7af0ee7461dc399b8c41e
4
+ data.tar.gz: df624753f2563939ddcb4c0f5093e5d26021e1587798f7d69985acb9d980c7cc
5
5
  SHA512:
6
- metadata.gz: 98590ea940f4f78a3acc12a50f5ef39fad42f5041531f514588e031c848a0c640cd8bcc29bebd6eab2372d3cc0e955e47ddc161c1f5d79cf77092bdb7bea3452
7
- data.tar.gz: 4dc1f91d80447947558d35745da44bf3a544af5c9a0635795c41d630596306125a4043b765ab9d76c6b46795500e4fad51b56af83ead5b19013c04282cca1921
6
+ metadata.gz: c70a16af5daec1ca1de21c571c1b7e0062e91628ceb5277b11675676444fa517dc7a1c959273b71824decc5d8ca3fae4f1f72c5e3f0c7eff9508a1e0202f6574
7
+ data.tar.gz: 777f55af979a6fe281df80ceec7ca5e84ab04d07a815edcf34a46fa9e13f03c514c003707bad4ddb099d214f72ffdbea67e345df01b8e2369e3d6cf069e07f99
data/ext/sass/Rakefile CHANGED
@@ -17,7 +17,6 @@ task install: %w[cli.rb]
17
17
  CLEAN.include %w[
18
18
  protoc.exe
19
19
  ruby
20
- true
21
20
  *.proto
22
21
  *.tar.gz
23
22
  *.zip
@@ -172,117 +171,6 @@ rule '_pb.rb' => %w[.proto protoc.exe] do |t|
172
171
  sh './protoc.exe', '--proto_path=.', '--ruby_out=.', t.source
173
172
  end
174
173
 
175
- file 'true' do |t|
176
- case Platform::CPU
177
- when 'aarch64'
178
- ei_class = ELF::ELFCLASS64
179
- ei_data = ELF::ELFDATA2LSB
180
- e_machine = 0xb7
181
- e_flags = 0
182
-
183
- # 0000000000400078 <PT_LOAD#0>:
184
- # 400078: d2800ba8 mov x8, #0x5d // =93
185
- # 40007c: d2800000 mov x0, #0x0 // =0
186
- # 400080: d4000001 svc #0
187
- entry_point = [0xd2800ba8, 0xd2800000, 0xd4000001].pack('L<3')
188
- when 'arm'
189
- ei_class = ELF::ELFCLASS32
190
- ei_data = ELF::ELFDATA2LSB
191
- e_machine = 0x28
192
- e_flags = 0x5000400
193
-
194
- # 00400054 <PT_LOAD#0>:
195
- # 400054: 2701 movs r7, #0x1
196
- # 400056: 2000 movs r0, #0x0
197
- # 400058: df00 svc #0x0
198
- entry_point = [0x2701, 0x2000, 0xdf00].pack('S<3')
199
- when 'riscv64'
200
- ei_class = ELF::ELFCLASS64
201
- ei_data = ELF::ELFDATA2LSB
202
- e_machine = 0xf3
203
- e_flags = 0x5
204
-
205
- # 0000000000400078 <PT_LOAD#0>:
206
- # 400078: 05d00893 li a7, 0x5d
207
- # 40007c: 4501 li a0, 0x0
208
- # 40007e: 00000073 ecall
209
- entry_point = [0x05d00893, 0x4501, 0x00000073].pack('L<S<L<')
210
- when 'x86_64'
211
- ei_class = ELF::ELFCLASS64
212
- ei_data = ELF::ELFDATA2LSB
213
- e_machine = 0x3e
214
- e_flags = 0
215
-
216
- # 0000000000400078 <PT_LOAD#0>:
217
- # 400078: 31 ff xorl %edi, %edi
218
- # 40007a: b8 3c 00 00 00 movl $0x3c, %eax
219
- # 40007f: 0f 05 syscall
220
- entry_point = %w[31ffb83c0000000f05].pack('H*')
221
- else
222
- raise NotImplementedError
223
- end
224
-
225
- case ei_class
226
- when ELF::ELFCLASS32
227
- e_ehsize = ELF::Elf32_Ehdr.sizeof
228
- e_phentsize = ELF::Elf32_Phdr.sizeof
229
- e_shentsize = ELF::Elf32_Shdr.sizeof
230
- when ELF::ELFCLASS64
231
- e_ehsize = ELF::Elf64_Ehdr.sizeof
232
- e_phentsize = ELF::Elf64_Phdr.sizeof
233
- e_shentsize = ELF::Elf64_Shdr.sizeof
234
- else
235
- raise EncodingError
236
- end
237
-
238
- e_phoff = e_ehsize
239
-
240
- p_offset = e_phoff + e_phentsize
241
- p_vaddr = (2**22) + p_offset
242
- p_filesz = entry_point.length
243
- p_memsz = p_filesz
244
-
245
- e_entry = p_vaddr
246
- e_entry += 1 if Platform::CPU == 'arm'
247
-
248
- ELF.allocate.instance_eval do
249
- @ehdr = {
250
- e_ident: [127, 69, 76, 70, ei_class, ei_data, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
251
- e_type: ELF::ET_EXEC,
252
- e_machine:,
253
- e_version: 1,
254
- e_entry:,
255
- e_phoff:,
256
- e_shoff: 0,
257
- e_flags:,
258
- e_ehsize:,
259
- e_phentsize:,
260
- e_phnum: 1,
261
- e_shentsize:,
262
- e_shnum: 0,
263
- e_shstrndx: 0
264
- }
265
- @phdrs = [
266
- {
267
- p_type: ELF::PT_LOAD,
268
- p_flags: ELF::PF_R | ELF::PF_X,
269
- p_offset:,
270
- p_vaddr:,
271
- p_paddr: 0,
272
- p_filesz:,
273
- p_memsz:,
274
- p_align: 4096
275
- }
276
- ]
277
- @shdrs = []
278
-
279
- File.open(t.name, 'wb', 0o755) do |file|
280
- dump(file)
281
- file.write(entry_point)
282
- end
283
- end
284
- end
285
-
286
174
  # This is a FileUtils extension that defines several additional commands to be
287
175
  # added to the FileUtils utility functions.
288
176
  module FileUtils
@@ -359,91 +247,6 @@ end
359
247
 
360
248
  # The {Platform} module.
361
249
  module Platform
362
- # @see https://docs.freebsd.org/en/articles/linux-emulation/
363
- # @see https://docs.freebsd.org/en/books/handbook/linuxemu/
364
- module Linuxulator
365
- module_function
366
-
367
- def enabled?
368
- return false unless RbConfig::CONFIG['host_os'].include?('freebsd')
369
-
370
- return true if defined?(Platform::OS) && Platform::OS.include?('linux')
371
-
372
- begin
373
- Rake::Task['true'].invoke unless File.exist?('true')
374
- rescue NotImplementedError
375
- return false
376
- end
377
-
378
- system('./true', %i[out err] => File::NULL) == true
379
- end
380
-
381
- def host_os(root = compat_linux_emul_path)
382
- return 'linux-none' unless File.symlink?(File.absolute_path('proc/self/exe', root))
383
-
384
- if (Platform::CPU == 'aarch64' &&
385
- File.exist?(File.absolute_path('lib/ld-linux-aarch64.so.1', root))) ||
386
- (Platform::CPU == 'riscv64' &&
387
- File.exist?(File.absolute_path('lib/ld-linux-riscv64-lp64d.so.1', root))) ||
388
- (Platform::CPU == 'x86_64' &&
389
- File.exist?(File.absolute_path('lib64/ld-linux-x86-64.so.2', root)))
390
- return 'linux-gnu'
391
- end
392
-
393
- if Platform::CPU == 'arm' &&
394
- File.exist?(File.absolute_path('lib/ld-linux-armhf.so.3', root))
395
- return 'linux-gnueabihf'
396
- end
397
-
398
- if %w[aarch64 riscv64 x86_64].include?(Platform::CPU) &&
399
- File.exist?(File.absolute_path("lib/ld-musl-#{Platform::CPU}.so.1", root))
400
- return 'linux-musl'
401
- end
402
-
403
- if Platform::CPU == 'arm' &&
404
- File.exist?(File.absolute_path('lib/ld-musl-armhf.so.1', root))
405
- return 'linux-musleabihf'
406
- end
407
-
408
- if %w[aarch64 riscv64 x86_64].include?(Platform::CPU) &&
409
- File.exist?(File.absolute_path('system/bin/linker64', root))
410
- return 'linux-android'
411
- end
412
-
413
- if Platform::CPU == 'arm' &&
414
- File.exist?(File.absolute_path('system/bin/linker', root))
415
- return 'linux-androideabi'
416
- end
417
-
418
- 'linux-none'
419
- end
420
-
421
- def compat_linux_emul_path
422
- require 'fiddle'
423
-
424
- lib = Fiddle.dlopen(nil)
425
- sysctlbyname = Fiddle::Function.new(
426
- lib['sysctlbyname'],
427
- [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_SIZE_T],
428
- Fiddle::TYPE_INT
429
- )
430
-
431
- name = Fiddle::Pointer.to_ptr('compat.linux.emul_path')
432
- oldp = Fiddle::NULL
433
- oldlenp = Fiddle::Pointer.malloc(Fiddle::SIZEOF_SIZE_T, Fiddle::RUBY_FREE)
434
- newp = Fiddle::NULL
435
- newlen = 0
436
- raise SystemCallError.new(nil, Fiddle.last_error) if sysctlbyname.call(name, oldp, oldlenp, newp, newlen) == -1
437
-
438
- oldp = Fiddle::Pointer.malloc(oldlenp.ptr.to_i, Fiddle::RUBY_FREE)
439
- raise SystemCallError.new(nil, Fiddle.last_error) if sysctlbyname.call(name, oldp, oldlenp, newp, newlen) == -1
440
-
441
- oldp.to_s
442
- rescue SystemCallError
443
- nil
444
- end
445
- end
446
-
447
250
  HOST_CPU = RbConfig::CONFIG['host_cpu'].downcase
448
251
 
449
252
  CPU = case HOST_CPU
@@ -461,7 +264,7 @@ module Platform
461
264
  HOST_CPU
462
265
  end
463
266
 
464
- HOST_OS = (Linuxulator.enabled? ? Linuxulator.host_os : RbConfig::CONFIG['host_os']).downcase
267
+ HOST_OS = RbConfig::CONFIG['host_os'].downcase
465
268
 
466
269
  OS = case HOST_OS
467
270
  when /darwin/
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "dependencies": {
3
- "sass": "file:sass-1.97.2.tgz"
3
+ "sass": "file:sass-1.97.3.tgz"
4
4
  }
5
5
  }
Binary file
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  module Embedded
5
- VERSION = '1.97.2'
5
+ VERSION = '1.97.3'
6
6
  end
7
7
  end
@@ -5,46 +5,54 @@ module Sass
5
5
  #
6
6
  # It tracks objects that need to be closed after `Process.fork`.
7
7
  module ForkTracker
8
- HASH = {}.compare_by_identity
8
+ module_function
9
9
 
10
- MUTEX = Mutex.new
10
+ if Process.respond_to?(:_fork)
11
+ # TODO: remove next line once ruby 3.1 support is dropped
12
+ require 'set' unless defined?(::Set)
11
13
 
12
- private_constant :HASH, :MUTEX
14
+ SET = Set.new.compare_by_identity
13
15
 
14
- module_function
16
+ MUTEX = Mutex.new
17
+
18
+ private_constant :SET, :MUTEX
15
19
 
16
- def add(obj)
17
- MUTEX.synchronize do
18
- HASH[obj] = true
20
+ def add(object)
21
+ MUTEX.synchronize do
22
+ SET.add(object)
23
+ end
19
24
  end
20
- end
21
25
 
22
- def delete(obj)
23
- MUTEX.synchronize do
24
- HASH.delete(obj)
26
+ def delete(object)
27
+ MUTEX.synchronize do
28
+ SET.delete(object)
29
+ end
25
30
  end
26
- end
27
31
 
28
- def each(...)
29
- MUTEX.synchronize do
30
- HASH.keys
31
- end.each(...)
32
- end
32
+ def each(&)
33
+ MUTEX.synchronize do
34
+ SET.to_a
35
+ end.each(&)
36
+ end
33
37
 
34
- # The {CoreExt} module.
35
- #
36
- # It closes objects after `Process.fork`.
37
- module CoreExt
38
- def _fork
39
- pid = super
40
- ForkTracker.each(&:close) if pid.zero?
41
- pid
38
+ # The {CoreExt} module.
39
+ #
40
+ # It closes objects after `Process.fork`.
41
+ module CoreExt
42
+ def _fork
43
+ pid = super
44
+ ForkTracker.each(&:close) if pid.zero?
45
+ pid
46
+ end
42
47
  end
43
- end
44
48
 
45
- private_constant :CoreExt
49
+ private_constant :CoreExt
46
50
 
47
- Process.singleton_class.prepend(CoreExt) if Process.respond_to?(:_fork)
51
+ Process.singleton_class.prepend(CoreExt)
52
+ else
53
+ def add(object); end
54
+ def delete(object); end
55
+ end
48
56
  end
49
57
 
50
58
  private_constant :ForkTracker
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.97.2
4
+ version: 1.97.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -52,7 +52,7 @@ files:
52
52
  - exe/sass
53
53
  - ext/sass/Rakefile
54
54
  - ext/sass/package.json
55
- - ext/sass/sass-1.97.2.tgz
55
+ - ext/sass/sass-1.97.3.tgz
56
56
  - lib/sass-embedded.rb
57
57
  - lib/sass/calculation_value.rb
58
58
  - lib/sass/calculation_value/calculation_operation.rb
@@ -126,8 +126,8 @@ licenses:
126
126
  - MIT
127
127
  metadata:
128
128
  bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
129
- documentation_uri: https://rubydoc.info/gems/sass-embedded/1.97.2
130
- source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.97.2
129
+ documentation_uri: https://rubydoc.info/gems/sass-embedded/1.97.3
130
+ source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.97.3
131
131
  funding_uri: https://github.com/sponsors/ntkme
132
132
  rubygems_mfa_required: 'true'
133
133
  rdoc_options: []
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 4.0.3
147
+ rubygems_version: 4.0.4
148
148
  specification_version: 4
149
149
  summary: Use dart-sass with Ruby!
150
150
  test_files: []
Binary file