sass-embedded 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 573a157ee6e0c3fa51cefec5c011649717718133d934e031a339d32a84838a13
4
- data.tar.gz: ef27dd3177b8f58f3dd19180340686901597e9ac05efa77e2f9cc12b7784dbbb
3
+ metadata.gz: 98e2d595f559611d4bf150ab826be0386123267999a77b52b37b29b780dacadc
4
+ data.tar.gz: 409876982853e88acef3ea3a0d9dde84c6d4ad12e63fccfa24236fb6de0d1911
5
5
  SHA512:
6
- metadata.gz: 538de1728de2da841ce66648d669acec38a4a3c3f15357e5d33e1d5dac773f246b43f29d244ec39076fc3d18504f6935374f9a5277baac7a1c400548b44aef5b
7
- data.tar.gz: 26db551dd98592327a0c7e4fc9ee39c5917b1aff92431bfc7cdac6eea3c79899439c976512c7bed393493f564fd00e0ccafe735fe8cd8a514827d7a42b689d58
6
+ metadata.gz: 4275d81a3be35d78b111c8d34b04046e4390c5def447dd1d91cf9ea042ae9d31c87a7c05842666f83609565f69146fb8c5a6f617501d5e604251e70fbbf0121f
7
+ data.tar.gz: 0bcd2e6d4d45fe029ff751fcc0f884c7b31fb829cd9ed17a0e2b6ae5d7916f7013e6f4a5e61c4e5e2d06972a58e4514cb70b7eb5fa6ce129a398dd1ce125611c
data/ext/sass/extconf.rb CHANGED
@@ -215,9 +215,11 @@ module Sass
215
215
  def default_sass_embedded_protocol
216
216
  repo = 'sass/embedded-protocol'
217
217
 
218
- tag_name = IO.popen([Compiler::PATH, '--version']) do |file|
219
- JSON.parse(file.read)['protocolVersion']
220
- end
218
+ stdout, stderr, status = Open3.capture3(Compiler::PATH, '--version')
219
+
220
+ raise stderr unless status.success?
221
+
222
+ tag_name = JSON.parse(stdout)['protocolVersion']
221
223
 
222
224
  "https://raw.githubusercontent.com/#{repo}/#{tag_name}/embedded_sass.proto"
223
225
  end
@@ -33,7 +33,7 @@ module Sass
33
33
 
34
34
  id = @id
35
35
  @id = id.next
36
- @observers.store(id, observer)
36
+ @observers[id] = observer
37
37
  id
38
38
  end
39
39
  end
@@ -76,9 +76,11 @@ module Sass
76
76
  half_close
77
77
  @observers[message.id]&.send(outbound_message.message, message)
78
78
  when :compile_response, :version_response
79
- @observers[message.id]&.send(outbound_message.message, message)
79
+ @observers[message.id].send(outbound_message.message, message)
80
80
  when :log_event, :canonicalize_request, :import_request, :file_import_request, :function_call_request
81
- @observers[message.compilation_id]&.send(outbound_message.message, message)
81
+ Thread.new(@observers[message.compilation_id]) do |observer|
82
+ observer.send(outbound_message.message, message)
83
+ end
82
84
  else
83
85
  raise ArgumentError, "Unknown OutboundMessage.message #{message}"
84
86
  end
@@ -35,7 +35,7 @@ module Sass
35
35
  logger:,
36
36
  quiet_deps:,
37
37
  verbose:)
38
- async do
38
+ await do
39
39
  @function_registry = FunctionRegistry.new(functions, alert_color: alert_color)
40
40
  @importer_registry = ImporterRegistry.new(importers, load_paths, alert_color: alert_color)
41
41
  @logger_registry = LoggerRegistry.new(logger)
@@ -67,7 +67,7 @@ module Sass
67
67
  end
68
68
 
69
69
  def version_request
70
- async do
70
+ await do
71
71
  send_message EmbeddedProtocol::InboundMessage.new(
72
72
  version_request: EmbeddedProtocol::InboundMessage::VersionRequest.new(
73
73
  id: id
@@ -118,7 +118,7 @@ module Sass
118
118
 
119
119
  private
120
120
 
121
- def async
121
+ def await
122
122
  @mutex.synchronize do
123
123
  @connection = @channel.connect(self)
124
124
  @async = Async.new
@@ -9,20 +9,24 @@ module Sass
9
9
  module_function
10
10
 
11
11
  def from_proto_compile_response(compile_response)
12
- if compile_response.result == :failure
12
+ result = compile_response.send(compile_response.result)
13
+ case compile_response.result
14
+ when :failure
13
15
  raise CompileError.new(
14
- compile_response.failure.message,
15
- compile_response.failure.formatted,
16
- compile_response.failure.stack_trace,
17
- from_proto_source_span(compile_response.failure.span)
16
+ result.message,
17
+ result.formatted,
18
+ result.stack_trace,
19
+ from_proto_source_span(result.span)
18
20
  )
21
+ when :success
22
+ CompileResult.new(
23
+ result.css,
24
+ result.source_map,
25
+ result.loaded_urls
26
+ )
27
+ else
28
+ raise ArgumentError, "Unknown CompileResponse.result #{result}"
19
29
  end
20
-
21
- CompileResult.new(
22
- compile_response.success.css,
23
- compile_response.success.source_map,
24
- compile_response.success.loaded_urls
25
- )
26
30
  end
27
31
 
28
32
  def from_proto_source_span(source_span)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '0.19.0'
5
+ VERSION = '0.19.1'
6
6
  end
7
7
  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: 0.19.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -163,8 +163,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
163
163
  licenses:
164
164
  - MIT
165
165
  metadata:
166
- documentation_uri: https://www.rubydoc.info/gems/sass-embedded/0.19.0
167
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.0
166
+ documentation_uri: https://www.rubydoc.info/gems/sass-embedded/0.19.1
167
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.1
168
168
  funding_uri: https://github.com/sponsors/ntkme
169
169
  post_install_message:
170
170
  rdoc_options: []