sass-embedded 1.2.4 → 1.2.7
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 +2 -2
- data/ext/sass/package.json +1 -1
- data/lib/sass/embedded/dispatcher.rb +13 -23
- data/lib/sass/embedded/host.rb +8 -11
- data/lib/sass/embedded/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59c62fb9381e9bf2694476162f1834c03f73176cfd464844d42fb3acdb303f29
|
4
|
+
data.tar.gz: e907f1ec64689662f4f1de647bc1b6abfa24c03ffdbfb9f09a67c1122f2aaa42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f8c3d237c85d91d71908cfb415ae5b8787201c600fa98f350f7500c6302867bfb3f5978ac6f85e61b8e30dfa313b5ba6a379eee99cc930d6e966e30530d5284
|
7
|
+
data.tar.gz: f8bef00bf6309884eb5d619086b12ca3a9a1778a4ae613e7e40ee7218d7a140e964b7eab86a32da12402f54f2b8ca1fd92b96d56d7fb70fbb6994a687f6226f1
|
data/ext/sass/Rakefile
CHANGED
@@ -23,7 +23,7 @@ end
|
|
23
23
|
|
24
24
|
file 'embedded.rb' => %w[sass_embedded] do |t|
|
25
25
|
path = 'sass_embedded/dart-sass-embedded'
|
26
|
-
path = "#{path}#{
|
26
|
+
path = "#{path}#{['.exe', '.bat'].find { |ext| File.exist? "#{path}#{ext}" }}" if Gem.win_platform?
|
27
27
|
|
28
28
|
raise "#{path} not found" unless File.exist? path
|
29
29
|
|
@@ -183,7 +183,7 @@ module Configuration
|
|
183
183
|
when 'x86_64'
|
184
184
|
'x64'
|
185
185
|
when 'aarch64'
|
186
|
-
|
186
|
+
'arm64'
|
187
187
|
else
|
188
188
|
raise NotImplementedError, message
|
189
189
|
end
|
data/ext/sass/package.json
CHANGED
@@ -20,8 +20,10 @@ module Sass
|
|
20
20
|
loop do
|
21
21
|
receive_message EmbeddedProtocol::OutboundMessage.decode @compiler.read
|
22
22
|
rescue IOError, Errno::EBADF => e
|
23
|
-
|
24
|
-
|
23
|
+
@mutex.synchronize do
|
24
|
+
@id = PROTOCOL_ERROR_ID
|
25
|
+
@observers.values
|
26
|
+
end.each do |observer|
|
25
27
|
observer.error e
|
26
28
|
end
|
27
29
|
break
|
@@ -31,7 +33,7 @@ module Sass
|
|
31
33
|
|
32
34
|
def subscribe(observer)
|
33
35
|
@mutex.synchronize do
|
34
|
-
raise EOFError if
|
36
|
+
raise EOFError if @id == PROTOCOL_ERROR_ID
|
35
37
|
|
36
38
|
id = @id
|
37
39
|
@id = id.next
|
@@ -44,7 +46,7 @@ module Sass
|
|
44
46
|
@mutex.synchronize do
|
45
47
|
@observers.delete(id)
|
46
48
|
|
47
|
-
close if
|
49
|
+
close if @id == PROTOCOL_ERROR_ID && @observers.empty?
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
@@ -62,33 +64,21 @@ module Sass
|
|
62
64
|
|
63
65
|
private
|
64
66
|
|
65
|
-
def half_close
|
66
|
-
@mutex.synchronize do
|
67
|
-
@id = PROTOCOL_ERROR_ID
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def half_closed?
|
72
|
-
@id == PROTOCOL_ERROR_ID
|
73
|
-
end
|
74
|
-
|
75
67
|
def receive_message(outbound_message)
|
76
68
|
oneof = outbound_message.message
|
77
69
|
message = outbound_message.public_send(oneof)
|
78
70
|
case oneof
|
79
71
|
when :error
|
80
|
-
|
81
|
-
|
82
|
-
@observers.
|
83
|
-
|
84
|
-
|
85
|
-
else
|
86
|
-
@observers[message.id].public_send(oneof, message)
|
72
|
+
@mutex.synchronize do
|
73
|
+
@id = PROTOCOL_ERROR_ID
|
74
|
+
message.id == PROTOCOL_ERROR_ID ? @observers.values : [@observers[message.id]]
|
75
|
+
end.each do |observer|
|
76
|
+
observer.public_send(oneof, message)
|
87
77
|
end
|
88
78
|
when :compile_response, :version_response
|
89
|
-
@observers[message.id].public_send(oneof, message)
|
79
|
+
@mutex.synchronize { @observers[message.id] }.public_send(oneof, message)
|
90
80
|
when :log_event, :canonicalize_request, :import_request, :file_import_request, :function_call_request
|
91
|
-
Thread.new(@observers[message.compilation_id]) do |observer|
|
81
|
+
Thread.new(@mutex.synchronize { @observers[message.compilation_id] }) do |observer|
|
92
82
|
observer.public_send(oneof, message)
|
93
83
|
end
|
94
84
|
else
|
data/lib/sass/embedded/host.rb
CHANGED
@@ -13,7 +13,6 @@ module Sass
|
|
13
13
|
class Host
|
14
14
|
def initialize(channel)
|
15
15
|
@channel = channel
|
16
|
-
@mutex = Mutex.new
|
17
16
|
end
|
18
17
|
|
19
18
|
def id
|
@@ -126,16 +125,14 @@ module Sass
|
|
126
125
|
private
|
127
126
|
|
128
127
|
def await
|
129
|
-
@
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
@connection.disconnect
|
138
|
-
end
|
128
|
+
raise EOFError if defined? @async
|
129
|
+
|
130
|
+
@connection = @channel.connect(self)
|
131
|
+
@async = Async.new
|
132
|
+
yield
|
133
|
+
@async.await
|
134
|
+
ensure
|
135
|
+
@connection.disconnect
|
139
136
|
end
|
140
137
|
end
|
141
138
|
|
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.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -159,8 +159,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
|
|
159
159
|
licenses:
|
160
160
|
- MIT
|
161
161
|
metadata:
|
162
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.2.
|
163
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.2.
|
162
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.2.7
|
163
|
+
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.2.7
|
164
164
|
funding_uri: https://github.com/sponsors/ntkme
|
165
165
|
post_install_message:
|
166
166
|
rdoc_options: []
|