sass-embedded 1.63.4-arm-linux-gnueabihf → 1.63.5-arm-linux-gnueabihf
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/sass/dart-sass/src/dart +0 -0
- data/ext/sass/dart-sass/src/sass.snapshot +0 -0
- data/ext/sass/win32_api.rb +129 -0
- data/lib/sass/embedded/dispatcher.rb +5 -9
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/embedded.rb +1 -3
- data/lib/sass/embedded_protocol.rb +10 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1f6e5b1bec31005d1065e399d569b042bebb0d6a99638da0b168b7313d1361
|
4
|
+
data.tar.gz: 7b9054b10590ae296aa1f3623ffc24950333ccfccffc896267c81e1fb9524886
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c244f2428d19180d378bac64d2b0c33f1336283d719f3eae64c17642411e7d274c9e3b5417a0a1f6445967dbaf0f91061af3f9cccfe0c5f9d47f9c3e6a9d1e0c
|
7
|
+
data.tar.gz: 95584039d886edd14de373bb1d8d4f02191a12f26f12cffb1c52bed953ab34dd9dae979839e40678fafd0262dc3c5dfd4c9a9eb15587afe2b1ea25d3632a791a
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![build](https://github.com/ntkme/sass-embedded-host-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ntkme/sass-embedded-host-ruby/actions/workflows/build.yml)
|
4
4
|
[![gem](https://badge.fury.io/rb/sass-embedded.svg)](https://rubygems.org/gems/sass-embedded)
|
5
5
|
|
6
|
-
This is a Ruby library that implements the host side of the [Embedded Sass protocol](https://github.com/sass/embedded-protocol).
|
6
|
+
This is a Ruby library that implements the host side of the [Embedded Sass protocol](https://github.com/sass/sass/blob/HEAD/spec/embedded-protocol.md).
|
7
7
|
|
8
8
|
It exposes a Ruby API for Sass that's backed by a native [Dart Sass](https://sass-lang.com/dart-sass) executable.
|
9
9
|
|
data/ext/sass/dart-sass/src/dart
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fiddle'
|
4
|
+
|
5
|
+
# @!visibility private
|
6
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/api/
|
7
|
+
module Win32API
|
8
|
+
Kernel32 = Fiddle.dlopen('Kernel32.dll')
|
9
|
+
|
10
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants
|
11
|
+
module ImageFileMachineConstants
|
12
|
+
IMAGE_FILE_MACHINE_I386 = 0x014c
|
13
|
+
IMAGE_FILE_MACHINE_ARMNT = 0x01c4
|
14
|
+
IMAGE_FILE_MACHINE_AMD64 = 0x8664
|
15
|
+
IMAGE_FILE_MACHINE_ARM64 = 0xaa64
|
16
|
+
end
|
17
|
+
|
18
|
+
private_constant :ImageFileMachineConstants
|
19
|
+
|
20
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/ne-processthreadsapi-machine_attributes
|
21
|
+
module MachineAttributes
|
22
|
+
USER_ENABLED = 0x00000001
|
23
|
+
KERNEL_ENABLED = 0x00000002
|
24
|
+
WOW64_CONTAINER = 0x00000004
|
25
|
+
end
|
26
|
+
|
27
|
+
private_constant :MachineAttributes
|
28
|
+
|
29
|
+
# Specifies the ways in which an architecture of code can run on a host operating system.
|
30
|
+
class MachineTypeAttributes
|
31
|
+
def initialize(machine_type_attributes)
|
32
|
+
@machine_type_attributes = machine_type_attributes
|
33
|
+
end
|
34
|
+
|
35
|
+
# The specified architecture of code can run in user mode.
|
36
|
+
def user_enabled?
|
37
|
+
@machine_type_attributes & MachineAttributes::USER_ENABLED == MachineAttributes::USER_ENABLED
|
38
|
+
end
|
39
|
+
|
40
|
+
# The specified architecture of code can run in kernel mode.
|
41
|
+
def kernel_enabled?
|
42
|
+
@machine_type_attributes & MachineAttributes::KERNEL_ENABLED == MachineAttributes::KERNEL_ENABLED
|
43
|
+
end
|
44
|
+
|
45
|
+
# The specified architecture of code runs on WOW64.
|
46
|
+
def wow64_container?
|
47
|
+
@machine_type_attributes & MachineAttributes::WOW64_CONTAINER == MachineAttributes::WOW64_CONTAINER
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
private_constant :MachineTypeAttributes
|
52
|
+
|
53
|
+
class << self
|
54
|
+
def x86?
|
55
|
+
get_machine_type_attributes(ImageFileMachineConstants::IMAGE_FILE_MACHINE_I386).user_enabled?
|
56
|
+
end
|
57
|
+
|
58
|
+
def arm?
|
59
|
+
get_machine_type_attributes(ImageFileMachineConstants::IMAGE_FILE_MACHINE_ARMNT).user_enabled?
|
60
|
+
end
|
61
|
+
|
62
|
+
def x64?
|
63
|
+
get_machine_type_attributes(ImageFileMachineConstants::IMAGE_FILE_MACHINE_AMD64).user_enabled?
|
64
|
+
end
|
65
|
+
|
66
|
+
def arm64?
|
67
|
+
get_machine_type_attributes(ImageFileMachineConstants::IMAGE_FILE_MACHINE_ARM64).user_enabled?
|
68
|
+
end
|
69
|
+
|
70
|
+
private
|
71
|
+
|
72
|
+
begin
|
73
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getmachinetypeattributes
|
74
|
+
GetMachineTypeAttributes = Fiddle::Function.new(
|
75
|
+
Kernel32['GetMachineTypeAttributes'],
|
76
|
+
[-Fiddle::TYPE_SHORT, Fiddle::TYPE_VOIDP],
|
77
|
+
Fiddle::TYPE_LONG
|
78
|
+
)
|
79
|
+
|
80
|
+
def get_machine_type_attributes(machine)
|
81
|
+
p_machine_type_attributes = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT, Fiddle::RUBY_FREE)
|
82
|
+
raise Fiddle.win32_last_error unless GetMachineTypeAttributes.call(machine, p_machine_type_attributes).zero?
|
83
|
+
|
84
|
+
MachineTypeAttributes.new(p_machine_type_attributes.to_str.unpack1('i'))
|
85
|
+
end
|
86
|
+
rescue Fiddle::DLError
|
87
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess
|
88
|
+
GetCurrentProcess = Fiddle::Function.new(
|
89
|
+
Kernel32['GetCurrentProcess'],
|
90
|
+
[],
|
91
|
+
Fiddle::TYPE_VOIDP
|
92
|
+
)
|
93
|
+
|
94
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/api/wow64apiset/nf-wow64apiset-iswow64process2
|
95
|
+
IsWow64Process2 = Fiddle::Function.new(
|
96
|
+
Kernel32['IsWow64Process2'],
|
97
|
+
[Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP],
|
98
|
+
Fiddle::TYPE_CHAR
|
99
|
+
)
|
100
|
+
|
101
|
+
# @see https://learn.microsoft.com/en-us/windows/win32/api/wow64apiset/nf-wow64apiset-iswow64guestmachinesupported
|
102
|
+
IsWow64GuestMachineSupported = Fiddle::Function.new(
|
103
|
+
Kernel32['IsWow64GuestMachineSupported'],
|
104
|
+
[-Fiddle::TYPE_SHORT, Fiddle::TYPE_VOIDP],
|
105
|
+
Fiddle::TYPE_LONG
|
106
|
+
)
|
107
|
+
|
108
|
+
def get_machine_type_attributes(machine)
|
109
|
+
h_process = GetCurrentProcess.call
|
110
|
+
p_process_machine = Fiddle::Pointer.malloc(Fiddle::SIZEOF_SHORT, Fiddle::RUBY_FREE)
|
111
|
+
p_native_machine = Fiddle::Pointer.malloc(Fiddle::SIZEOF_SHORT, Fiddle::RUBY_FREE)
|
112
|
+
raise Fiddle.win32_last_error if IsWow64Process2.call(h_process, p_process_machine, p_native_machine).zero?
|
113
|
+
|
114
|
+
if p_native_machine.to_str.unpack1('S!') == machine
|
115
|
+
return MachineTypeAttributes.new(MachineAttributes::USER_ENABLED | MachineAttributes::KERNEL_ENABLED)
|
116
|
+
end
|
117
|
+
|
118
|
+
p_machine_is_supported = Fiddle::Pointer.malloc(Fiddle::SIZEOF_CHAR, Fiddle::RUBY_FREE)
|
119
|
+
raise Fiddle.win32_last_error unless IsWow64GuestMachineSupported.call(machine, p_machine_is_supported).zero?
|
120
|
+
|
121
|
+
if p_machine_is_supported.to_str.unpack1('c').zero?
|
122
|
+
MachineTypeAttributes.new(0)
|
123
|
+
else
|
124
|
+
MachineTypeAttributes.new(MachineAttributes::USER_ENABLED | MachineAttributes::WOW64_CONTAINER)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -46,15 +46,11 @@ module Sass
|
|
46
46
|
|
47
47
|
return unless @observers.empty?
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
# Resetting @id can cause a race condition in compiler
|
56
|
-
# See: https://github.com/sass/dart-sass/issues/2004
|
57
|
-
close if @id == UINT_MAX
|
49
|
+
if @id == UINT_MAX
|
50
|
+
close
|
51
|
+
else
|
52
|
+
@id = 1
|
53
|
+
end
|
58
54
|
end
|
59
55
|
end
|
60
56
|
|
data/lib/sass/embedded.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative '../../ext/sass/cli'
|
4
|
-
require_relative '../../ext/sass/embedded_sass_pb'
|
5
4
|
require_relative 'compile_error'
|
6
5
|
require_relative 'compile_result'
|
7
6
|
require_relative 'embedded/connection'
|
@@ -12,6 +11,7 @@ require_relative 'embedded/resilient_dispatcher'
|
|
12
11
|
require_relative 'embedded/structifier'
|
13
12
|
require_relative 'embedded/varint'
|
14
13
|
require_relative 'embedded/version'
|
14
|
+
require_relative 'embedded_protocol'
|
15
15
|
require_relative 'logger/silent'
|
16
16
|
require_relative 'logger/source_location'
|
17
17
|
require_relative 'logger/source_span'
|
@@ -247,6 +247,4 @@ module Sass
|
|
247
247
|
@dispatcher.closed?
|
248
248
|
end
|
249
249
|
end
|
250
|
-
|
251
|
-
private_constant :EmbeddedProtocol
|
252
250
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-embedded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.63.
|
4
|
+
version: 1.63.5
|
5
5
|
platform: arm-linux-gnueabihf
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- ext/sass/dart-sass/src/dart
|
43
43
|
- ext/sass/dart-sass/src/sass.snapshot
|
44
44
|
- ext/sass/embedded_sass_pb.rb
|
45
|
+
- ext/sass/win32_api.rb
|
45
46
|
- lib/sass-embedded.rb
|
46
47
|
- lib/sass/compile_error.rb
|
47
48
|
- lib/sass/compile_result.rb
|
@@ -59,6 +60,7 @@ files:
|
|
59
60
|
- lib/sass/embedded/structifier.rb
|
60
61
|
- lib/sass/embedded/varint.rb
|
61
62
|
- lib/sass/embedded/version.rb
|
63
|
+
- lib/sass/embedded_protocol.rb
|
62
64
|
- lib/sass/logger/silent.rb
|
63
65
|
- lib/sass/logger/source_location.rb
|
64
66
|
- lib/sass/logger/source_span.rb
|
@@ -79,8 +81,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
|
|
79
81
|
licenses:
|
80
82
|
- MIT
|
81
83
|
metadata:
|
82
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.63.
|
83
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.63.
|
84
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.63.5
|
85
|
+
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.63.5
|
84
86
|
funding_uri: https://github.com/sponsors/ntkme
|
85
87
|
post_install_message:
|
86
88
|
rdoc_options: []
|