sass-embedded 1.70.0 → 1.71.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/sass/Rakefile +20 -14
- data/ext/sass/embedded_sass_pb.rb +2 -1
- data/ext/sass/package.json +1 -1
- data/lib/sass/calculation_value/calculation_operation.rb +1 -1
- data/lib/sass/compiler/{dispatcher_manager.rb → channel.rb} +10 -10
- data/lib/sass/compiler/dispatcher.rb +2 -2
- data/lib/sass/compiler/host/function_registry.rb +8 -10
- data/lib/sass/compiler/host/importer_registry.rb +35 -27
- data/lib/sass/compiler/host/logger_registry.rb +2 -0
- data/lib/sass/compiler/host.rb +11 -11
- data/lib/sass/compiler.rb +11 -9
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/embedded.rb +1 -1
- data/lib/sass/node_package_importer.rb +17 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3840aaedc1217afa93f684b5006d63172fce4064514df2075fef79b1f8b19f71
|
4
|
+
data.tar.gz: a33958f5eadd06673a19cfab547d771d2dafb177c237f5ff8bd3d5a1742f4e42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5374ff3768944d740c99602b2e4d27289ae984d7dafe1e74db9cedbaf988e982ff6cf58f313e574665375f5e7195c72e2334639556d4e69e3b0b03d58755a22
|
7
|
+
data.tar.gz: 2c388012a0c1acbd5b05383726edcf8d645ed2678cc6aaab7b397b73970761f869bf30477bc84c23416719cbe402cb829086cc428fc81b61b986a3fda81306a5
|
data/ext/sass/Rakefile
CHANGED
@@ -21,7 +21,7 @@ file 'dart-sass' do |t|
|
|
21
21
|
raise if ENV.key?('DART_SASS')
|
22
22
|
|
23
23
|
gem_install 'sass-embedded', SassConfig.gem_version, SassConfig.gem_platform do |dir|
|
24
|
-
|
24
|
+
mv File.absolute_path("ext/sass/#{t.name}", dir), t.name
|
25
25
|
end
|
26
26
|
rescue StandardError
|
27
27
|
archive = fetch(ENV.fetch('DART_SASS') { SassConfig.default_dart_sass })
|
@@ -138,16 +138,22 @@ module FileUtils
|
|
138
138
|
def fetch(source_uri, dest_path = nil)
|
139
139
|
require 'rubygems/remote_fetcher'
|
140
140
|
|
141
|
-
|
141
|
+
source_uri = begin
|
142
|
+
Gem::Uri.parse!(source_uri)
|
143
|
+
rescue NoMethodError
|
142
144
|
begin
|
143
|
-
|
145
|
+
URI.parse(source_uri)
|
144
146
|
rescue StandardError
|
145
|
-
|
147
|
+
URI.parse(URI::DEFAULT_PARSER.escape(source_uri.to_s))
|
146
148
|
end
|
147
149
|
end
|
148
150
|
|
149
151
|
scheme = source_uri.scheme
|
150
|
-
source_path =
|
152
|
+
source_path = begin
|
153
|
+
Gem::URI::DEFAULT_PARSER
|
154
|
+
rescue NameError
|
155
|
+
URI::DEFAULT_PARSER
|
156
|
+
end.unescape(source_uri.path || source_uri.opaque)
|
151
157
|
|
152
158
|
if Gem.win_platform? && scheme =~ /^[a-z]$/i && !source_path.include?(':')
|
153
159
|
source_path = "#{scheme}:#{source_path}"
|
@@ -167,10 +173,7 @@ module FileUtils
|
|
167
173
|
symbol = :"fetch_#{scheme}"
|
168
174
|
raise ArgumentError, "Unsupported URI scheme #{scheme}" unless fetcher.respond_to?(symbol)
|
169
175
|
|
170
|
-
if Rake::FileUtilsExt.verbose_flag
|
171
|
-
redacted_uri = Gem::RemoteFetcher::FetchError.new('', source_uri).uri
|
172
|
-
Rake.rake_output_message "fetch #{redacted_uri}"
|
173
|
-
end
|
176
|
+
Rake.rake_output_message "fetch #{Gem::Uri.new(source_uri).redacted}" if Rake::FileUtilsExt.verbose_flag
|
174
177
|
|
175
178
|
unless Rake::FileUtilsExt.nowrite_flag
|
176
179
|
data = fetcher.public_send(symbol, source_uri)
|
@@ -182,7 +185,7 @@ module FileUtils
|
|
182
185
|
end
|
183
186
|
|
184
187
|
def gem_install(name, version, platform)
|
185
|
-
install_dir = File.absolute_path('ruby'
|
188
|
+
install_dir = File.absolute_path('ruby')
|
186
189
|
|
187
190
|
if Rake::FileUtilsExt.verbose_flag
|
188
191
|
Rake.rake_output_message [
|
@@ -279,6 +282,8 @@ module SassConfig
|
|
279
282
|
|
280
283
|
message = "dart-sass for #{Platform::ARCH} not available at #{repo}/releases/tag/#{tag_name}"
|
281
284
|
|
285
|
+
env = ''
|
286
|
+
|
282
287
|
os = case Platform::OS
|
283
288
|
when 'darwin'
|
284
289
|
'macos'
|
@@ -287,7 +292,8 @@ module SassConfig
|
|
287
292
|
when 'linux-android'
|
288
293
|
'android'
|
289
294
|
when 'linux-musl'
|
290
|
-
'
|
295
|
+
env = '-musl'
|
296
|
+
'linux'
|
291
297
|
when 'windows'
|
292
298
|
'windows'
|
293
299
|
else
|
@@ -309,7 +315,7 @@ module SassConfig
|
|
309
315
|
|
310
316
|
ext = Platform::OS == 'windows' ? 'zip' : 'tar.gz'
|
311
317
|
|
312
|
-
"#{repo}/releases/download/#{tag_name}/dart-sass-#{tag_name}-#{os}-#{cpu}.#{ext}"
|
318
|
+
"#{repo}/releases/download/#{tag_name}/dart-sass-#{tag_name}-#{os}-#{cpu}#{env}.#{ext}"
|
313
319
|
end
|
314
320
|
|
315
321
|
def default_protoc
|
@@ -351,7 +357,7 @@ module SassConfig
|
|
351
357
|
|
352
358
|
uri = "#{repo}/#{version}/protoc-#{version}-#{os}-#{cpu}.exe"
|
353
359
|
|
354
|
-
Gem::RemoteFetcher.fetcher.fetch_https(
|
360
|
+
Gem::RemoteFetcher.fetcher.fetch_https(Gem::Uri.new("#{uri}.sha1"))
|
355
361
|
|
356
362
|
uri
|
357
363
|
rescue Gem::RemoteFetcher::FetchError
|
@@ -362,7 +368,7 @@ module SassConfig
|
|
362
368
|
tuples.sort.reverse_each do |name_tuple, _source|
|
363
369
|
uri = "#{repo}/#{name_tuple.version}/protoc-#{name_tuple.version}-#{os}-#{cpu}.exe"
|
364
370
|
|
365
|
-
Gem::RemoteFetcher.fetcher.fetch_https(
|
371
|
+
Gem::RemoteFetcher.fetcher.fetch_https(Gem::Uri.new("#{uri}.sha1"))
|
366
372
|
|
367
373
|
return uri
|
368
374
|
rescue Gem::RemoteFetcher::FetchError
|
@@ -5,7 +5,7 @@
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
7
|
|
8
|
-
descriptor_data = "\n\x13\x65mbedded_sass.proto\x12\x16sass.embedded_protocol\"\x87\x0f\n\x0eInboundMessage\x12P\n\x0f\x63ompile_request\x18\x02 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.CompileRequestH\x00\x12\\\n\x15\x63\x61nonicalize_response\x18\x03 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.CanonicalizeResponseH\x00\x12P\n\x0fimport_response\x18\x04 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.ImportResponseH\x00\x12Y\n\x14\x66ile_import_response\x18\x05 \x01(\x0b\x32\x39.sass.embedded_protocol.InboundMessage.FileImportResponseH\x00\x12]\n\x16\x66unction_call_response\x18\x06 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.FunctionCallResponseH\x00\x12P\n\x0fversion_request\x18\x07 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.VersionRequestH\x00\x1a\x1c\n\x0eVersionRequest\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xf5\x05\n\x0e\x43ompileRequest\x12S\n\x06string\x18\x02 \x01(\x0b\x32\x41.sass.embedded_protocol.InboundMessage.CompileRequest.StringInputH\x00\x12\x0e\n\x04path\x18\x03 \x01(\tH\x00\x12\x32\n\x05style\x18\x04 \x01(\x0e\x32#.sass.embedded_protocol.OutputStyle\x12\x12\n\nsource_map\x18\x05 \x01(\x08\x12Q\n\timporters\x18\x06 \x03(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x12\x18\n\x10global_functions\x18\x07 \x03(\t\x12\x13\n\x0b\x61lert_color\x18\x08 \x01(\x08\x12\x13\n\x0b\x61lert_ascii\x18\t \x01(\x08\x12\x0f\n\x07verbose\x18\n \x01(\x08\x12\x12\n\nquiet_deps\x18\x0b \x01(\x08\x12\"\n\x1asource_map_include_sources\x18\x0c \x01(\x08\x12\x0f\n\x07\x63harset\x18\r \x01(\x08\x12\x0e\n\x06silent\x18\x0e \x01(\x08\x1a\xac\x01\n\x0bStringInput\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12.\n\x06syntax\x18\x03 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12P\n\x08importer\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x1aw\n\x08Importer\x12\x0e\n\x04path\x18\x01 \x01(\tH\x00\x12\x15\n\x0bimporter_id\x18\x02 \x01(\rH\x00\x12\x1a\n\x10\x66ile_importer_id\x18\x03 \x01(\rH\x00\x12\x1c\n\x14non_canonical_scheme\x18\x04 \x03(\tB\n\n\x08importerB\x07\n\x05inputJ\x04\x08\x01\x10\x02\x1aL\n\x14\x43\x61nonicalizeResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\r\n\x03url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x93\x02\n\x0eImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12V\n\x07success\x18\x02 \x01(\x0b\x32\x43.sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccessH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x1a\x81\x01\n\rImportSuccess\x12\x10\n\x08\x63ontents\x18\x01 \x01(\t\x12.\n\x06syntax\x18\x02 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12\x1b\n\x0esource_map_url\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_source_map_urlB\x08\n\x06result\x1aO\n\x12\x46ileImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x12\n\x08\x66ile_url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x90\x01\n\x14\x46unctionCallResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x30\n\x07success\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.ValueH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x12\x1f\n\x17\x61\x63\x63\x65ssed_argument_lists\x18\x04 \x03(\rB\x08\n\x06resultB\t\n\x07message\"\x97\x0f\n\x0fOutboundMessage\x12\x36\n\x05\x65rror\x18\x01 \x01(\x0b\x32%.sass.embedded_protocol.ProtocolErrorH\x00\x12S\n\x10\x63ompile_response\x18\x02 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.CompileResponseH\x00\x12\x45\n\tlog_event\x18\x03 \x01(\x0b\x32\x30.sass.embedded_protocol.OutboundMessage.LogEventH\x00\x12[\n\x14\x63\x61nonicalize_request\x18\x04 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.CanonicalizeRequestH\x00\x12O\n\x0eimport_request\x18\x05 \x01(\x0b\x32\x35.sass.embedded_protocol.OutboundMessage.ImportRequestH\x00\x12X\n\x13\x66ile_import_request\x18\x06 \x01(\x0b\x32\x39.sass.embedded_protocol.OutboundMessage.FileImportRequestH\x00\x12\\\n\x15\x66unction_call_request\x18\x07 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.FunctionCallRequestH\x00\x12S\n\x10version_response\x18\x08 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.VersionResponseH\x00\x1a\x8e\x01\n\x0fVersionResponse\x12\n\n\x02id\x18\x05 \x01(\r\x12\x18\n\x10protocol_version\x18\x01 \x01(\t\x12\x18\n\x10\x63ompiler_version\x18\x02 \x01(\t\x12\x1e\n\x16implementation_version\x18\x03 \x01(\t\x12\x1b\n\x13implementation_name\x18\x04 \x01(\t\x1a\xa2\x03\n\x0f\x43ompileResponse\x12Y\n\x07success\x18\x02 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileSuccessH\x00\x12Y\n\x07\x66\x61ilure\x18\x03 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailureH\x00\x12\x13\n\x0bloaded_urls\x18\x04 \x03(\t\x1a\x37\n\x0e\x43ompileSuccess\x12\x0b\n\x03\x63ss\x18\x01 \x01(\t\x12\x12\n\nsource_map\x18\x02 \x01(\tJ\x04\x08\x03\x10\x04\x1a{\n\x0e\x43ompileFailure\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x30\n\x04span\x18\x02 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpan\x12\x13\n\x0bstack_trace\x18\x03 \x01(\t\x12\x11\n\tformatted\x18\x04 \x01(\tB\x08\n\x06resultJ\x04\x08\x01\x10\x02\x1a\xbd\x01\n\x08LogEvent\x12\x32\n\x04type\x18\x02 \x01(\x0e\x32$.sass.embedded_protocol.LogEventType\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x35\n\x04span\x18\x04 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpanH\x00\x88\x01\x01\x12\x13\n\x0bstack_trace\x18\x05 \x01(\t\x12\x11\n\tformatted\x18\x06 \x01(\tB\x07\n\x05_spanJ\x04\x08\x01\x10\x02\x1a\x8e\x01\n\x13\x43\x61nonicalizeRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x43\n\rImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\tJ\x04\x08\x02\x10\x03\x1a\x8c\x01\n\x11\x46ileImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x8e\x01\n\x13\x46unctionCallRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x12\x15\n\x0b\x66unction_id\x18\x04 \x01(\rH\x00\x12\x30\n\targuments\x18\x05 \x03(\x0b\x32\x1d.sass.embedded_protocol.ValueB\x0c\n\nidentifierJ\x04\x08\x02\x10\x03\x42\t\n\x07message\"e\n\rProtocolError\x12\x37\n\x04type\x18\x01 \x01(\x0e\x32).sass.embedded_protocol.ProtocolErrorType\x12\n\n\x02id\x18\x02 \x01(\r\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x87\x02\n\nSourceSpan\x12\x0c\n\x04text\x18\x01 \x01(\t\x12@\n\x05start\x18\x02 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocation\x12\x43\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocationH\x00\x88\x01\x01\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x05 \x01(\t\x1a>\n\x0eSourceLocation\x12\x0e\n\x06offset\x18\x01 \x01(\r\x12\x0c\n\x04line\x18\x02 \x01(\r\x12\x0e\n\x06\x63olumn\x18\x03 \x01(\rB\x06\n\x04_end\"\xb8\x13\n\x05Value\x12\x36\n\x06string\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.StringH\x00\x12\x36\n\x06number\x18\x02 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12;\n\trgb_color\x18\x03 \x01(\x0b\x32&.sass.embedded_protocol.Value.RgbColorH\x00\x12;\n\thsl_color\x18\x04 \x01(\x0b\x32&.sass.embedded_protocol.Value.HslColorH\x00\x12\x32\n\x04list\x18\x05 \x01(\x0b\x32\".sass.embedded_protocol.Value.ListH\x00\x12\x30\n\x03map\x18\x06 \x01(\x0b\x32!.sass.embedded_protocol.Value.MapH\x00\x12;\n\tsingleton\x18\x07 \x01(\x0e\x32&.sass.embedded_protocol.SingletonValueH\x00\x12K\n\x11\x63ompiler_function\x18\x08 \x01(\x0b\x32..sass.embedded_protocol.Value.CompilerFunctionH\x00\x12\x43\n\rhost_function\x18\t \x01(\x0b\x32*.sass.embedded_protocol.Value.HostFunctionH\x00\x12\x43\n\rargument_list\x18\n \x01(\x0b\x32*.sass.embedded_protocol.Value.ArgumentListH\x00\x12;\n\thwb_color\x18\x0b \x01(\x0b\x32&.sass.embedded_protocol.Value.HwbColorH\x00\x12@\n\x0b\x63\x61lculation\x18\x0c \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x12\x45\n\x0e\x63ompiler_mixin\x18\r \x01(\x0b\x32+.sass.embedded_protocol.Value.CompilerMixinH\x00\x1a&\n\x06String\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x0e\n\x06quoted\x18\x02 \x01(\x08\x1a\x41\n\x06Number\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x12\n\nnumerators\x18\x02 \x03(\t\x12\x14\n\x0c\x64\x65nominators\x18\x03 \x03(\t\x1a\x43\n\x08RgbColor\x12\x0b\n\x03red\x18\x01 \x01(\r\x12\r\n\x05green\x18\x02 \x01(\r\x12\x0c\n\x04\x62lue\x18\x03 \x01(\r\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aM\n\x08HslColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x12\n\nsaturation\x18\x02 \x01(\x01\x12\x11\n\tlightness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aL\n\x08HwbColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x11\n\twhiteness\x18\x02 \x01(\x01\x12\x11\n\tblackness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1a\x87\x01\n\x04List\x12\x38\n\tseparator\x18\x01 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12\x14\n\x0chas_brackets\x18\x02 \x01(\x08\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\xa2\x01\n\x03Map\x12\x38\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\'.sass.embedded_protocol.Value.Map.Entry\x1a\x61\n\x05\x45ntry\x12*\n\x03key\x18\x01 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\x1e\n\x10\x43ompilerFunction\x12\n\n\x02id\x18\x01 \x01(\r\x1a-\n\x0cHostFunction\x12\n\n\x02id\x18\x01 \x01(\r\x12\x11\n\tsignature\x18\x02 \x01(\t\x1a\x1b\n\rCompilerMixin\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xa1\x02\n\x0c\x41rgumentList\x12\n\n\x02id\x18\x01 \x01(\r\x12\x38\n\tseparator\x18\x02 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x12J\n\x08keywords\x18\x04 \x03(\x0b\x32\x38.sass.embedded_protocol.Value.ArgumentList.KeywordsEntry\x1aN\n\rKeywordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value:\x02\x38\x01\x1a\xef\x04\n\x0b\x43\x61lculation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\targuments\x18\x02 \x03(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x1a\x95\x02\n\x10\x43\x61lculationValue\x12\x36\n\x06number\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12\x10\n\x06string\x18\x02 \x01(\tH\x00\x12\x17\n\rinterpolation\x18\x03 \x01(\tH\x00\x12S\n\toperation\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.Value.Calculation.CalculationOperationH\x00\x12@\n\x0b\x63\x61lculation\x18\x05 \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x42\x07\n\x05value\x1a\xea\x01\n\x14\x43\x61lculationOperation\x12=\n\x08operator\x18\x01 \x01(\x0e\x32+.sass.embedded_protocol.CalculationOperator\x12H\n\x04left\x18\x02 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x12I\n\x05right\x18\x03 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValueB\x07\n\x05value*+\n\x0bOutputStyle\x12\x0c\n\x08\x45XPANDED\x10\x00\x12\x0e\n\nCOMPRESSED\x10\x01*)\n\x06Syntax\x12\x08\n\x04SCSS\x10\x00\x12\x0c\n\x08INDENTED\x10\x01\x12\x07\n\x03\x43SS\x10\x02*?\n\x0cLogEventType\x12\x0b\n\x07WARNING\x10\x00\x12\x17\n\x13\x44\x45PRECATION_WARNING\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x02*8\n\x11ProtocolErrorType\x12\t\n\x05PARSE\x10\x00\x12\n\n\x06PARAMS\x10\x01\x12\x0c\n\x08INTERNAL\x10\x02*?\n\rListSeparator\x12\t\n\x05\x43OMMA\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\t\n\x05SLASH\x10\x02\x12\r\n\tUNDECIDED\x10\x03*/\n\x0eSingletonValue\x12\x08\n\x04TRUE\x10\x00\x12\t\n\x05\x46\x41LSE\x10\x01\x12\x08\n\x04NULL\x10\x02*A\n\x13\x43\x61lculationOperator\x12\x08\n\x04PLUS\x10\x00\x12\t\n\x05MINUS\x10\x01\x12\t\n\x05TIMES\x10\x02\x12\n\n\x06\x44IVIDE\x10\x03\x42#\n\x1f\x63om.sass_lang.embedded_protocolP\x01\x62\x06proto3"
|
8
|
+
descriptor_data = "\n\x13\x65mbedded_sass.proto\x12\x16sass.embedded_protocol\"\xd6\x0f\n\x0eInboundMessage\x12P\n\x0f\x63ompile_request\x18\x02 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.CompileRequestH\x00\x12\\\n\x15\x63\x61nonicalize_response\x18\x03 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.CanonicalizeResponseH\x00\x12P\n\x0fimport_response\x18\x04 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.ImportResponseH\x00\x12Y\n\x14\x66ile_import_response\x18\x05 \x01(\x0b\x32\x39.sass.embedded_protocol.InboundMessage.FileImportResponseH\x00\x12]\n\x16\x66unction_call_response\x18\x06 \x01(\x0b\x32;.sass.embedded_protocol.InboundMessage.FunctionCallResponseH\x00\x12P\n\x0fversion_request\x18\x07 \x01(\x0b\x32\x35.sass.embedded_protocol.InboundMessage.VersionRequestH\x00\x1a\x1c\n\x0eVersionRequest\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xc4\x06\n\x0e\x43ompileRequest\x12S\n\x06string\x18\x02 \x01(\x0b\x32\x41.sass.embedded_protocol.InboundMessage.CompileRequest.StringInputH\x00\x12\x0e\n\x04path\x18\x03 \x01(\tH\x00\x12\x32\n\x05style\x18\x04 \x01(\x0e\x32#.sass.embedded_protocol.OutputStyle\x12\x12\n\nsource_map\x18\x05 \x01(\x08\x12Q\n\timporters\x18\x06 \x03(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x12\x18\n\x10global_functions\x18\x07 \x03(\t\x12\x13\n\x0b\x61lert_color\x18\x08 \x01(\x08\x12\x13\n\x0b\x61lert_ascii\x18\t \x01(\x08\x12\x0f\n\x07verbose\x18\n \x01(\x08\x12\x12\n\nquiet_deps\x18\x0b \x01(\x08\x12\"\n\x1asource_map_include_sources\x18\x0c \x01(\x08\x12\x0f\n\x07\x63harset\x18\r \x01(\x08\x12\x0e\n\x06silent\x18\x0e \x01(\x08\x1a\xac\x01\n\x0bStringInput\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12.\n\x06syntax\x18\x03 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12P\n\x08importer\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.InboundMessage.CompileRequest.Importer\x1a\xc5\x01\n\x08Importer\x12\x0e\n\x04path\x18\x01 \x01(\tH\x00\x12\x15\n\x0bimporter_id\x18\x02 \x01(\rH\x00\x12\x1a\n\x10\x66ile_importer_id\x18\x03 \x01(\rH\x00\x12L\n\x15node_package_importer\x18\x05 \x01(\x0b\x32+.sass.embedded_protocol.NodePackageImporterH\x00\x12\x1c\n\x14non_canonical_scheme\x18\x04 \x03(\tB\n\n\x08importerB\x07\n\x05inputJ\x04\x08\x01\x10\x02\x1aL\n\x14\x43\x61nonicalizeResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\r\n\x03url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x93\x02\n\x0eImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12V\n\x07success\x18\x02 \x01(\x0b\x32\x43.sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccessH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x1a\x81\x01\n\rImportSuccess\x12\x10\n\x08\x63ontents\x18\x01 \x01(\t\x12.\n\x06syntax\x18\x02 \x01(\x0e\x32\x1e.sass.embedded_protocol.Syntax\x12\x1b\n\x0esource_map_url\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_source_map_urlB\x08\n\x06result\x1aO\n\x12\x46ileImportResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x12\n\x08\x66ile_url\x18\x02 \x01(\tH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x42\x08\n\x06result\x1a\x90\x01\n\x14\x46unctionCallResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x30\n\x07success\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.ValueH\x00\x12\x0f\n\x05\x65rror\x18\x03 \x01(\tH\x00\x12\x1f\n\x17\x61\x63\x63\x65ssed_argument_lists\x18\x04 \x03(\rB\x08\n\x06resultB\t\n\x07message\"\x97\x0f\n\x0fOutboundMessage\x12\x36\n\x05\x65rror\x18\x01 \x01(\x0b\x32%.sass.embedded_protocol.ProtocolErrorH\x00\x12S\n\x10\x63ompile_response\x18\x02 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.CompileResponseH\x00\x12\x45\n\tlog_event\x18\x03 \x01(\x0b\x32\x30.sass.embedded_protocol.OutboundMessage.LogEventH\x00\x12[\n\x14\x63\x61nonicalize_request\x18\x04 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.CanonicalizeRequestH\x00\x12O\n\x0eimport_request\x18\x05 \x01(\x0b\x32\x35.sass.embedded_protocol.OutboundMessage.ImportRequestH\x00\x12X\n\x13\x66ile_import_request\x18\x06 \x01(\x0b\x32\x39.sass.embedded_protocol.OutboundMessage.FileImportRequestH\x00\x12\\\n\x15\x66unction_call_request\x18\x07 \x01(\x0b\x32;.sass.embedded_protocol.OutboundMessage.FunctionCallRequestH\x00\x12S\n\x10version_response\x18\x08 \x01(\x0b\x32\x37.sass.embedded_protocol.OutboundMessage.VersionResponseH\x00\x1a\x8e\x01\n\x0fVersionResponse\x12\n\n\x02id\x18\x05 \x01(\r\x12\x18\n\x10protocol_version\x18\x01 \x01(\t\x12\x18\n\x10\x63ompiler_version\x18\x02 \x01(\t\x12\x1e\n\x16implementation_version\x18\x03 \x01(\t\x12\x1b\n\x13implementation_name\x18\x04 \x01(\t\x1a\xa2\x03\n\x0f\x43ompileResponse\x12Y\n\x07success\x18\x02 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileSuccessH\x00\x12Y\n\x07\x66\x61ilure\x18\x03 \x01(\x0b\x32\x46.sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailureH\x00\x12\x13\n\x0bloaded_urls\x18\x04 \x03(\t\x1a\x37\n\x0e\x43ompileSuccess\x12\x0b\n\x03\x63ss\x18\x01 \x01(\t\x12\x12\n\nsource_map\x18\x02 \x01(\tJ\x04\x08\x03\x10\x04\x1a{\n\x0e\x43ompileFailure\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x30\n\x04span\x18\x02 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpan\x12\x13\n\x0bstack_trace\x18\x03 \x01(\t\x12\x11\n\tformatted\x18\x04 \x01(\tB\x08\n\x06resultJ\x04\x08\x01\x10\x02\x1a\xbd\x01\n\x08LogEvent\x12\x32\n\x04type\x18\x02 \x01(\x0e\x32$.sass.embedded_protocol.LogEventType\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x35\n\x04span\x18\x04 \x01(\x0b\x32\".sass.embedded_protocol.SourceSpanH\x00\x88\x01\x01\x12\x13\n\x0bstack_trace\x18\x05 \x01(\t\x12\x11\n\tformatted\x18\x06 \x01(\tB\x07\n\x05_spanJ\x04\x08\x01\x10\x02\x1a\x8e\x01\n\x13\x43\x61nonicalizeRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x43\n\rImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\tJ\x04\x08\x02\x10\x03\x1a\x8c\x01\n\x11\x46ileImportRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x13\n\x0bimporter_id\x18\x03 \x01(\r\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x13\n\x0b\x66rom_import\x18\x05 \x01(\x08\x12\x1b\n\x0e\x63ontaining_url\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x11\n\x0f_containing_urlJ\x04\x08\x02\x10\x03\x1a\x8e\x01\n\x13\x46unctionCallRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0e\n\x04name\x18\x03 \x01(\tH\x00\x12\x15\n\x0b\x66unction_id\x18\x04 \x01(\rH\x00\x12\x30\n\targuments\x18\x05 \x03(\x0b\x32\x1d.sass.embedded_protocol.ValueB\x0c\n\nidentifierJ\x04\x08\x02\x10\x03\x42\t\n\x07message\"e\n\rProtocolError\x12\x37\n\x04type\x18\x01 \x01(\x0e\x32).sass.embedded_protocol.ProtocolErrorType\x12\n\n\x02id\x18\x02 \x01(\r\x12\x0f\n\x07message\x18\x03 \x01(\t\"\x87\x02\n\nSourceSpan\x12\x0c\n\x04text\x18\x01 \x01(\t\x12@\n\x05start\x18\x02 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocation\x12\x43\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x31.sass.embedded_protocol.SourceSpan.SourceLocationH\x00\x88\x01\x01\x12\x0b\n\x03url\x18\x04 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x05 \x01(\t\x1a>\n\x0eSourceLocation\x12\x0e\n\x06offset\x18\x01 \x01(\r\x12\x0c\n\x04line\x18\x02 \x01(\r\x12\x0e\n\x06\x63olumn\x18\x03 \x01(\rB\x06\n\x04_end\"\xb8\x13\n\x05Value\x12\x36\n\x06string\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.StringH\x00\x12\x36\n\x06number\x18\x02 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12;\n\trgb_color\x18\x03 \x01(\x0b\x32&.sass.embedded_protocol.Value.RgbColorH\x00\x12;\n\thsl_color\x18\x04 \x01(\x0b\x32&.sass.embedded_protocol.Value.HslColorH\x00\x12\x32\n\x04list\x18\x05 \x01(\x0b\x32\".sass.embedded_protocol.Value.ListH\x00\x12\x30\n\x03map\x18\x06 \x01(\x0b\x32!.sass.embedded_protocol.Value.MapH\x00\x12;\n\tsingleton\x18\x07 \x01(\x0e\x32&.sass.embedded_protocol.SingletonValueH\x00\x12K\n\x11\x63ompiler_function\x18\x08 \x01(\x0b\x32..sass.embedded_protocol.Value.CompilerFunctionH\x00\x12\x43\n\rhost_function\x18\t \x01(\x0b\x32*.sass.embedded_protocol.Value.HostFunctionH\x00\x12\x43\n\rargument_list\x18\n \x01(\x0b\x32*.sass.embedded_protocol.Value.ArgumentListH\x00\x12;\n\thwb_color\x18\x0b \x01(\x0b\x32&.sass.embedded_protocol.Value.HwbColorH\x00\x12@\n\x0b\x63\x61lculation\x18\x0c \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x12\x45\n\x0e\x63ompiler_mixin\x18\r \x01(\x0b\x32+.sass.embedded_protocol.Value.CompilerMixinH\x00\x1a&\n\x06String\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x0e\n\x06quoted\x18\x02 \x01(\x08\x1a\x41\n\x06Number\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x12\n\nnumerators\x18\x02 \x03(\t\x12\x14\n\x0c\x64\x65nominators\x18\x03 \x03(\t\x1a\x43\n\x08RgbColor\x12\x0b\n\x03red\x18\x01 \x01(\r\x12\r\n\x05green\x18\x02 \x01(\r\x12\x0c\n\x04\x62lue\x18\x03 \x01(\r\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aM\n\x08HslColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x12\n\nsaturation\x18\x02 \x01(\x01\x12\x11\n\tlightness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1aL\n\x08HwbColor\x12\x0b\n\x03hue\x18\x01 \x01(\x01\x12\x11\n\twhiteness\x18\x02 \x01(\x01\x12\x11\n\tblackness\x18\x03 \x01(\x01\x12\r\n\x05\x61lpha\x18\x04 \x01(\x01\x1a\x87\x01\n\x04List\x12\x38\n\tseparator\x18\x01 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12\x14\n\x0chas_brackets\x18\x02 \x01(\x08\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\xa2\x01\n\x03Map\x12\x38\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\'.sass.embedded_protocol.Value.Map.Entry\x1a\x61\n\x05\x45ntry\x12*\n\x03key\x18\x01 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value\x1a\x1e\n\x10\x43ompilerFunction\x12\n\n\x02id\x18\x01 \x01(\r\x1a-\n\x0cHostFunction\x12\n\n\x02id\x18\x01 \x01(\r\x12\x11\n\tsignature\x18\x02 \x01(\t\x1a\x1b\n\rCompilerMixin\x12\n\n\x02id\x18\x01 \x01(\r\x1a\xa1\x02\n\x0c\x41rgumentList\x12\n\n\x02id\x18\x01 \x01(\r\x12\x38\n\tseparator\x18\x02 \x01(\x0e\x32%.sass.embedded_protocol.ListSeparator\x12/\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x1d.sass.embedded_protocol.Value\x12J\n\x08keywords\x18\x04 \x03(\x0b\x32\x38.sass.embedded_protocol.Value.ArgumentList.KeywordsEntry\x1aN\n\rKeywordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.sass.embedded_protocol.Value:\x02\x38\x01\x1a\xef\x04\n\x0b\x43\x61lculation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12M\n\targuments\x18\x02 \x03(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x1a\x95\x02\n\x10\x43\x61lculationValue\x12\x36\n\x06number\x18\x01 \x01(\x0b\x32$.sass.embedded_protocol.Value.NumberH\x00\x12\x10\n\x06string\x18\x02 \x01(\tH\x00\x12\x17\n\rinterpolation\x18\x03 \x01(\tH\x00\x12S\n\toperation\x18\x04 \x01(\x0b\x32>.sass.embedded_protocol.Value.Calculation.CalculationOperationH\x00\x12@\n\x0b\x63\x61lculation\x18\x05 \x01(\x0b\x32).sass.embedded_protocol.Value.CalculationH\x00\x42\x07\n\x05value\x1a\xea\x01\n\x14\x43\x61lculationOperation\x12=\n\x08operator\x18\x01 \x01(\x0e\x32+.sass.embedded_protocol.CalculationOperator\x12H\n\x04left\x18\x02 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValue\x12I\n\x05right\x18\x03 \x01(\x0b\x32:.sass.embedded_protocol.Value.Calculation.CalculationValueB\x07\n\x05value\"4\n\x13NodePackageImporter\x12\x1d\n\x15\x65ntry_point_directory\x18\x01 \x01(\t*+\n\x0bOutputStyle\x12\x0c\n\x08\x45XPANDED\x10\x00\x12\x0e\n\nCOMPRESSED\x10\x01*)\n\x06Syntax\x12\x08\n\x04SCSS\x10\x00\x12\x0c\n\x08INDENTED\x10\x01\x12\x07\n\x03\x43SS\x10\x02*?\n\x0cLogEventType\x12\x0b\n\x07WARNING\x10\x00\x12\x17\n\x13\x44\x45PRECATION_WARNING\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x02*8\n\x11ProtocolErrorType\x12\t\n\x05PARSE\x10\x00\x12\n\n\x06PARAMS\x10\x01\x12\x0c\n\x08INTERNAL\x10\x02*?\n\rListSeparator\x12\t\n\x05\x43OMMA\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\t\n\x05SLASH\x10\x02\x12\r\n\tUNDECIDED\x10\x03*/\n\x0eSingletonValue\x12\x08\n\x04TRUE\x10\x00\x12\t\n\x05\x46\x41LSE\x10\x01\x12\x08\n\x04NULL\x10\x02*A\n\x13\x43\x61lculationOperator\x12\x08\n\x04PLUS\x10\x00\x12\t\n\x05MINUS\x10\x01\x12\t\n\x05TIMES\x10\x02\x12\n\n\x06\x44IVIDE\x10\x03\x42#\n\x1f\x63om.sass_lang.embedded_protocolP\x01\x62\x06proto3"
|
9
9
|
|
10
10
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
11
|
|
@@ -72,6 +72,7 @@ module Sass
|
|
72
72
|
Value::Calculation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Value.Calculation").msgclass
|
73
73
|
Value::Calculation::CalculationValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Value.Calculation.CalculationValue").msgclass
|
74
74
|
Value::Calculation::CalculationOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Value.Calculation.CalculationOperation").msgclass
|
75
|
+
NodePackageImporter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.NodePackageImporter").msgclass
|
75
76
|
OutputStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.OutputStyle").enummodule
|
76
77
|
Syntax = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.Syntax").enummodule
|
77
78
|
LogEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sass.embedded_protocol.LogEventType").enummodule
|
data/ext/sass/package.json
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
module Sass
|
4
4
|
class Compiler
|
5
|
-
# The {
|
5
|
+
# The {Channel} class.
|
6
6
|
#
|
7
7
|
# It manages the lifecycle of {Dispatcher}.
|
8
|
-
class
|
8
|
+
class Channel
|
9
9
|
def initialize(dispatcher_class)
|
10
10
|
@dispatcher_class = dispatcher_class
|
11
11
|
@dispatcher = @dispatcher_class.new
|
@@ -27,19 +27,19 @@ module Sass
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def stream(host)
|
31
31
|
@mutex.synchronize do
|
32
32
|
raise IOError, 'closed compiler' if @dispatcher.nil?
|
33
33
|
|
34
|
-
|
34
|
+
Stream.new(@dispatcher, host)
|
35
35
|
rescue Errno::EBUSY
|
36
36
|
@dispatcher = @dispatcher_class.new
|
37
|
-
|
37
|
+
Stream.new(@dispatcher, host)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
# The {
|
42
|
-
class
|
41
|
+
# The {Stream} between {Dispatcher} and {Host}.
|
42
|
+
class Stream
|
43
43
|
attr_reader :id
|
44
44
|
|
45
45
|
def initialize(dispatcher, host)
|
@@ -47,7 +47,7 @@ module Sass
|
|
47
47
|
@id = @dispatcher.subscribe(host)
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
50
|
+
def close
|
51
51
|
@dispatcher.unsubscribe(@id)
|
52
52
|
end
|
53
53
|
|
@@ -60,9 +60,9 @@ module Sass
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
private_constant :
|
63
|
+
private_constant :Stream
|
64
64
|
end
|
65
65
|
|
66
|
-
private_constant :
|
66
|
+
private_constant :Channel
|
67
67
|
end
|
68
68
|
end
|
@@ -4,11 +4,11 @@ module Sass
|
|
4
4
|
class Compiler
|
5
5
|
# The {Dispatcher} class.
|
6
6
|
#
|
7
|
-
# It dispatches messages between
|
7
|
+
# It dispatches messages between multiple instances of {Host} and a single {Connection} to the compiler.
|
8
8
|
class Dispatcher
|
9
9
|
def initialize
|
10
10
|
@id = 1
|
11
|
-
@observers = {}
|
11
|
+
@observers = {}.compare_by_identity
|
12
12
|
@mutex = Mutex.new
|
13
13
|
@connection = Connection.new(self)
|
14
14
|
ForkTracker.add(self)
|
@@ -23,22 +23,20 @@ module Sass
|
|
23
23
|
end
|
24
24
|
|
25
25
|
@id = 0
|
26
|
-
@functions_by_id = {}
|
27
|
-
@ids_by_function = {}
|
26
|
+
@functions_by_id = {}.compare_by_identity
|
27
|
+
@ids_by_function = {}.compare_by_identity
|
28
28
|
|
29
29
|
@highlight = alert_color
|
30
30
|
end
|
31
31
|
|
32
32
|
def register(function)
|
33
|
-
|
33
|
+
@ids_by_function.fetch(function) do |fn|
|
34
|
+
id = @id
|
35
|
+
@id = id.next
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
@ids_by_function[function] = id
|
39
|
-
@functions_by_id[id] = function
|
40
|
-
|
41
|
-
id
|
37
|
+
@functions_by_id[id] = fn
|
38
|
+
@ids_by_function[fn] = id
|
39
|
+
end
|
42
40
|
end
|
43
41
|
|
44
42
|
def function_call(function_call_request)
|
@@ -11,7 +11,7 @@ module Sass
|
|
11
11
|
|
12
12
|
def initialize(importers, load_paths, alert_color:)
|
13
13
|
@id = 0
|
14
|
-
@importers_by_id = {}
|
14
|
+
@importers_by_id = {}.compare_by_identity
|
15
15
|
@importers = importers
|
16
16
|
.map { |importer| register(importer) }
|
17
17
|
.concat(
|
@@ -26,35 +26,43 @@ module Sass
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def register(importer)
|
29
|
-
importer
|
30
|
-
|
31
|
-
is_importer = importer.respond_to?(:canonicalize) && importer.respond_to?(:load)
|
32
|
-
is_file_importer = importer.respond_to?(:find_file_url)
|
33
|
-
|
34
|
-
raise ArgumentError, 'importer must be an Importer or a FileImporter' if is_importer == is_file_importer
|
35
|
-
|
36
|
-
id = @id
|
37
|
-
@id = id.next
|
38
|
-
|
39
|
-
@importers_by_id[id] = importer
|
40
|
-
if is_importer
|
29
|
+
if importer.is_a?(Sass::NodePackageImporter)
|
41
30
|
EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
if non_canonical_scheme.is_a?(String)
|
46
|
-
[non_canonical_scheme]
|
47
|
-
else
|
48
|
-
non_canonical_scheme || []
|
49
|
-
end
|
50
|
-
else
|
51
|
-
[]
|
52
|
-
end
|
31
|
+
node_package_importer: EmbeddedProtocol::NodePackageImporter.new(
|
32
|
+
entry_point_directory: importer.instance_eval { @entry_point_directory }
|
33
|
+
)
|
53
34
|
)
|
54
35
|
else
|
55
|
-
|
56
|
-
|
57
|
-
)
|
36
|
+
importer = Structifier.to_struct(importer, :canonicalize, :load, :non_canonical_scheme, :find_file_url)
|
37
|
+
|
38
|
+
is_importer = importer.respond_to?(:canonicalize) && importer.respond_to?(:load)
|
39
|
+
is_file_importer = importer.respond_to?(:find_file_url)
|
40
|
+
|
41
|
+
raise ArgumentError, 'importer must be an Importer or a FileImporter' if is_importer == is_file_importer
|
42
|
+
|
43
|
+
id = @id
|
44
|
+
@id = id.next
|
45
|
+
|
46
|
+
@importers_by_id[id] = importer
|
47
|
+
if is_importer
|
48
|
+
EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
|
49
|
+
importer_id: id,
|
50
|
+
non_canonical_scheme: if importer.respond_to?(:non_canonical_scheme)
|
51
|
+
non_canonical_scheme = importer.non_canonical_scheme
|
52
|
+
if non_canonical_scheme.is_a?(String)
|
53
|
+
[non_canonical_scheme]
|
54
|
+
else
|
55
|
+
non_canonical_scheme || []
|
56
|
+
end
|
57
|
+
else
|
58
|
+
[]
|
59
|
+
end
|
60
|
+
)
|
61
|
+
else
|
62
|
+
EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
|
63
|
+
file_importer_id: id
|
64
|
+
)
|
65
|
+
end
|
58
66
|
end
|
59
67
|
end
|
60
68
|
|
data/lib/sass/compiler/host.rb
CHANGED
@@ -12,8 +12,8 @@ module Sass
|
|
12
12
|
#
|
13
13
|
# It communicates with {Dispatcher} and handles the host logic.
|
14
14
|
class Host
|
15
|
-
def initialize(
|
16
|
-
@
|
15
|
+
def initialize(channel)
|
16
|
+
@channel = channel
|
17
17
|
end
|
18
18
|
|
19
19
|
def compile_request(path:,
|
@@ -80,13 +80,13 @@ module Sass
|
|
80
80
|
result.formatted == '' ? nil : result.formatted,
|
81
81
|
result.stack_trace == '' ? nil : result.stack_trace,
|
82
82
|
result.span.nil? ? nil : Logger::SourceSpan.new(result.span),
|
83
|
-
compile_response.loaded_urls
|
83
|
+
compile_response.loaded_urls.to_a
|
84
84
|
)
|
85
85
|
when :success
|
86
86
|
CompileResult.new(
|
87
87
|
result.css,
|
88
88
|
result.source_map == '' ? nil : result.source_map,
|
89
|
-
compile_response.loaded_urls
|
89
|
+
compile_response.loaded_urls.to_a
|
90
90
|
)
|
91
91
|
else
|
92
92
|
raise ArgumentError, "Unknown CompileResponse.result #{result}"
|
@@ -128,7 +128,7 @@ module Sass
|
|
128
128
|
case message
|
129
129
|
when EmbeddedProtocol::ProtocolError
|
130
130
|
@error = Errno::EPROTO.new(message.message)
|
131
|
-
@
|
131
|
+
@stream.error(@error)
|
132
132
|
else
|
133
133
|
@error ||= message
|
134
134
|
end
|
@@ -138,7 +138,7 @@ module Sass
|
|
138
138
|
def log_event(message)
|
139
139
|
@logger_registry.log(message)
|
140
140
|
rescue StandardError => e
|
141
|
-
@
|
141
|
+
@stream.error(e)
|
142
142
|
end
|
143
143
|
|
144
144
|
def canonicalize_request(message)
|
@@ -186,7 +186,7 @@ module Sass
|
|
186
186
|
|
187
187
|
def listen
|
188
188
|
@queue = Queue.new
|
189
|
-
@
|
189
|
+
@stream = @channel.stream(self)
|
190
190
|
|
191
191
|
yield
|
192
192
|
|
@@ -194,22 +194,22 @@ module Sass
|
|
194
194
|
|
195
195
|
@result
|
196
196
|
ensure
|
197
|
-
@
|
197
|
+
@stream&.close
|
198
198
|
@queue&.close
|
199
199
|
end
|
200
200
|
|
201
201
|
def id
|
202
|
-
@
|
202
|
+
@stream.id
|
203
203
|
end
|
204
204
|
|
205
205
|
def send_message0(...)
|
206
206
|
inbound_message = EmbeddedProtocol::InboundMessage.new(...)
|
207
|
-
@
|
207
|
+
@stream.send_proto(0, EmbeddedProtocol::InboundMessage.encode(inbound_message))
|
208
208
|
end
|
209
209
|
|
210
210
|
def send_message(...)
|
211
211
|
inbound_message = EmbeddedProtocol::InboundMessage.new(...)
|
212
|
-
@
|
212
|
+
@stream.send_proto(id, EmbeddedProtocol::InboundMessage.encode(inbound_message))
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
data/lib/sass/compiler.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require_relative 'canonicalize_context'
|
4
4
|
require_relative 'compile_result'
|
5
|
+
require_relative 'compiler/channel'
|
5
6
|
require_relative 'compiler/connection'
|
6
7
|
require_relative 'compiler/dispatcher'
|
7
|
-
require_relative 'compiler/dispatcher_manager'
|
8
8
|
require_relative 'compiler/host'
|
9
9
|
require_relative 'compiler/varint'
|
10
10
|
require_relative 'embedded/version'
|
@@ -14,21 +14,23 @@ require_relative 'fork_tracker'
|
|
14
14
|
require_relative 'logger/silent'
|
15
15
|
require_relative 'logger/source_location'
|
16
16
|
require_relative 'logger/source_span'
|
17
|
+
require_relative 'node_package_importer'
|
17
18
|
require_relative 'serializer'
|
18
19
|
require_relative 'value'
|
19
20
|
|
20
21
|
module Sass
|
21
|
-
#
|
22
|
-
#
|
22
|
+
# A synchronous {Compiler}.
|
23
|
+
# Each compiler instance exposes the {#compile} and {#compile_string} methods within the lifespan of the compiler.
|
23
24
|
#
|
24
25
|
# @example
|
25
26
|
# sass = Sass::Compiler.new
|
26
27
|
# result = sass.compile_string('h1 { font-size: 40px; }')
|
27
28
|
# result = sass.compile('style.scss')
|
28
29
|
# sass.close
|
30
|
+
# @see https://sass-lang.com/documentation/js-api/classes/compiler/
|
29
31
|
class Compiler
|
30
32
|
def initialize
|
31
|
-
@
|
33
|
+
@channel = Channel.new(Dispatcher)
|
32
34
|
end
|
33
35
|
|
34
36
|
# Compiles the Sass file at +path+ to CSS.
|
@@ -77,7 +79,7 @@ module Sass
|
|
77
79
|
verbose: false)
|
78
80
|
raise ArgumentError, 'path must be set' if path.nil?
|
79
81
|
|
80
|
-
Host.new(@
|
82
|
+
Host.new(@channel).compile_request(
|
81
83
|
path:,
|
82
84
|
source: nil,
|
83
85
|
importer: nil,
|
@@ -151,7 +153,7 @@ module Sass
|
|
151
153
|
verbose: false)
|
152
154
|
raise ArgumentError, 'source must be set' if source.nil?
|
153
155
|
|
154
|
-
Host.new(@
|
156
|
+
Host.new(@channel).compile_request(
|
155
157
|
path: nil,
|
156
158
|
source:,
|
157
159
|
importer:,
|
@@ -177,16 +179,16 @@ module Sass
|
|
177
179
|
def info
|
178
180
|
@info ||= [
|
179
181
|
['sass-embedded', Embedded::VERSION, '(Embedded Host)', '[Ruby]'].join("\t"),
|
180
|
-
Host.new(@
|
182
|
+
Host.new(@channel).version_request.join("\t")
|
181
183
|
].join("\n").freeze
|
182
184
|
end
|
183
185
|
|
184
186
|
def close
|
185
|
-
@
|
187
|
+
@channel.close
|
186
188
|
end
|
187
189
|
|
188
190
|
def closed?
|
189
|
-
@
|
191
|
+
@channel.closed?
|
190
192
|
end
|
191
193
|
end
|
192
194
|
end
|
data/lib/sass/embedded.rb
CHANGED
@@ -55,7 +55,7 @@ module Sass
|
|
55
55
|
|
56
56
|
compiler = Class.new(Compiler) do
|
57
57
|
def initialize
|
58
|
-
@
|
58
|
+
@channel = Compiler.const_get(:Channel).new(Class.new(Compiler.const_get(:Dispatcher)) do
|
59
59
|
def initialize
|
60
60
|
super
|
61
61
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# The built-in Node.js package importer. This loads pkg: URLs from node_modules
|
5
|
+
# according to the standard Node.js resolution algorithm.
|
6
|
+
#
|
7
|
+
# @param entry_point_directory [String] The directory where the {NodePackageImporter} should start when resolving
|
8
|
+
# `pkg:` URLs in sources other than files on disk.
|
9
|
+
# @see https://sass-lang.com/documentation/js-api/classes/nodepackageimporter/
|
10
|
+
class NodePackageImporter
|
11
|
+
def initialize(entry_point_directory)
|
12
|
+
raise ArgumentError, 'entry_point_directory must be set' if entry_point_directory.nil?
|
13
|
+
|
14
|
+
@entry_point_directory = File.absolute_path(entry_point_directory)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
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.
|
4
|
+
version: 1.71.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -61,9 +61,9 @@ files:
|
|
61
61
|
- lib/sass/canonicalize_context.rb
|
62
62
|
- lib/sass/compile_result.rb
|
63
63
|
- lib/sass/compiler.rb
|
64
|
+
- lib/sass/compiler/channel.rb
|
64
65
|
- lib/sass/compiler/connection.rb
|
65
66
|
- lib/sass/compiler/dispatcher.rb
|
66
|
-
- lib/sass/compiler/dispatcher_manager.rb
|
67
67
|
- lib/sass/compiler/host.rb
|
68
68
|
- lib/sass/compiler/host/function_registry.rb
|
69
69
|
- lib/sass/compiler/host/importer_registry.rb
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/sass/logger/silent.rb
|
81
81
|
- lib/sass/logger/source_location.rb
|
82
82
|
- lib/sass/logger/source_span.rb
|
83
|
+
- lib/sass/node_package_importer.rb
|
83
84
|
- lib/sass/serializer.rb
|
84
85
|
- lib/sass/value.rb
|
85
86
|
- lib/sass/value/argument_list.rb
|
@@ -100,8 +101,8 @@ licenses:
|
|
100
101
|
- MIT
|
101
102
|
metadata:
|
102
103
|
bug_tracker_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/issues
|
103
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.
|
104
|
-
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.
|
104
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.71.1
|
105
|
+
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.71.1
|
105
106
|
funding_uri: https://github.com/sponsors/ntkme
|
106
107
|
rubygems_mfa_required: 'true'
|
107
108
|
post_install_message:
|
@@ -119,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
120
|
- !ruby/object:Gem::Version
|
120
121
|
version: '0'
|
121
122
|
requirements: []
|
122
|
-
rubygems_version: 3.5.
|
123
|
+
rubygems_version: 3.5.6
|
123
124
|
signing_key:
|
124
125
|
specification_version: 4
|
125
126
|
summary: Use dart-sass with Ruby!
|