sass-embedded 1.69.4-arm-linux-androideabi → 1.69.6-arm-linux-androideabi
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/README.md +1 -1
- data/exe/sass +2 -2
- data/ext/sass/dart-sass/src/LICENSE +32 -0
- data/ext/sass/dart-sass/src/dart +0 -0
- data/ext/sass/dart-sass/src/sass.snapshot +0 -0
- data/ext/sass/embedded_sass_pb.rb +1 -1
- data/lib/sass/compiler/connection.rb +92 -0
- data/lib/sass/{embedded → compiler}/dispatcher.rb +31 -10
- data/lib/sass/{embedded → compiler}/host/function_registry.rb +3 -3
- data/lib/sass/{embedded → compiler}/host/importer_registry.rb +3 -3
- data/lib/sass/{embedded → compiler}/host/logger_registry.rb +1 -1
- data/lib/sass/{embedded → compiler}/host/protofier.rb +1 -1
- data/lib/sass/{embedded → compiler}/host/structifier.rb +3 -3
- data/lib/sass/{embedded → compiler}/host/value_protofier.rb +1 -1
- data/lib/sass/{embedded → compiler}/host.rb +15 -13
- data/lib/sass/{embedded → compiler}/resilient_dispatcher.rb +5 -4
- data/lib/sass/{embedded → compiler}/varint.rb +1 -1
- data/lib/sass/compiler.rb +188 -0
- data/lib/sass/embedded/version.rb +2 -2
- data/lib/sass/embedded.rb +65 -205
- data/lib/sass/exception.rb +65 -0
- data/lib/sass/fork_tracker.rb +51 -0
- data/lib/sass/serializer.rb +73 -0
- data/lib/sass/value/argument_list.rb +1 -1
- data/lib/sass/value/color.rb +6 -6
- data/lib/sass/value/function.rb +1 -1
- data/lib/sass/value/map.rb +1 -1
- data/lib/sass/value/number.rb +11 -11
- data/lib/sass/value.rb +0 -1
- metadata +25 -23
- data/lib/sass/compile_error.rb +0 -31
- data/lib/sass/embedded/connection.rb +0 -68
- data/lib/sass/script_error.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c18a703e2bbcdb050d4923ce01bc04b61f092a2e7448fa46866ecfe3d652eda5
|
4
|
+
data.tar.gz: 5a2563c83f5c6d02ccbc3efd672b682965273c18256838d1bb68e5ce33ba8eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77188dfd18ed30c99f3278caa6cb5261de36da5e8673258549619ef81471defb3c493ae3cee4c0829d705ce39ea7f0353c5001805632ad162d94ed373c84a833
|
7
|
+
data.tar.gz: 0c2300e48cf863b49e486b186783e9c6867c44eac6242648a2f5a220b1a377fb10038abd9b2fe600197851c63f56d9f851ab805c59a52538b4a30c2c8107096a
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Embedded Sass Host for Ruby
|
2
2
|
|
3
|
-
[](https://github.com/sass-contrib/sass-embedded-host-ruby/actions/workflows/build.yml)
|
4
4
|
[](https://rubygems.org/gems/sass-embedded)
|
5
5
|
|
6
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).
|
data/exe/sass
CHANGED
@@ -7,13 +7,13 @@ module Sass
|
|
7
7
|
# The `sass` command line interface
|
8
8
|
class CLI
|
9
9
|
begin
|
10
|
-
exec(*COMMAND, *ARGV)
|
10
|
+
Kernel.exec(*COMMAND, *ARGV)
|
11
11
|
rescue Errno::ENOENT
|
12
12
|
require_relative '../lib/sass/elf'
|
13
13
|
|
14
14
|
raise if ELF::INTERPRETER.nil?
|
15
15
|
|
16
|
-
exec(ELF::INTERPRETER, *COMMAND, *ARGV)
|
16
|
+
Kernel.exec(ELF::INTERPRETER, *COMMAND, *ARGV)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -1570,6 +1570,38 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
1570
1570
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1571
1571
|
|
1572
1572
|
|
1573
|
+
--------------------------------------------------------------------------------
|
1574
|
+
|
1575
|
+
web license:
|
1576
|
+
|
1577
|
+
Copyright 2023, the Dart project authors.
|
1578
|
+
|
1579
|
+
Redistribution and use in source and binary forms, with or without
|
1580
|
+
modification, are permitted provided that the following conditions are
|
1581
|
+
met:
|
1582
|
+
* Redistributions of source code must retain the above copyright
|
1583
|
+
notice, this list of conditions and the following disclaimer.
|
1584
|
+
* Redistributions in binary form must reproduce the above
|
1585
|
+
copyright notice, this list of conditions and the following
|
1586
|
+
disclaimer in the documentation and/or other materials provided
|
1587
|
+
with the distribution.
|
1588
|
+
* Neither the name of Google LLC nor the names of its
|
1589
|
+
contributors may be used to endorse or promote products derived
|
1590
|
+
from this software without specific prior written permission.
|
1591
|
+
|
1592
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
1593
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
1594
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
1595
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
1596
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
1597
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
1598
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
1599
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
1600
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
1601
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
1602
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1603
|
+
|
1604
|
+
|
1573
1605
|
--------------------------------------------------------------------------------
|
1574
1606
|
|
1575
1607
|
yaml license:
|
data/ext/sass/dart-sass/src/dart
CHANGED
Binary file
|
Binary file
|
@@ -11,7 +11,7 @@ pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
14
|
-
rescue TypeError
|
14
|
+
rescue TypeError
|
15
15
|
# Compatibility code: will be removed in the next major version.
|
16
16
|
require 'google/protobuf/descriptor_pb'
|
17
17
|
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'open3'
|
4
|
+
|
5
|
+
require_relative '../../../ext/sass/cli'
|
6
|
+
|
7
|
+
module Sass
|
8
|
+
class Compiler
|
9
|
+
# The stdio based {Connection} between the {Dispatcher} and the compiler.
|
10
|
+
#
|
11
|
+
# It runs the `sass --embedded` command.
|
12
|
+
class Connection
|
13
|
+
def initialize(dispatcher)
|
14
|
+
@mutex = Mutex.new
|
15
|
+
@stdin, @stdout, @stderr, @wait_thread = begin
|
16
|
+
Open3.popen3(*CLI::COMMAND, '--embedded', chdir: __dir__)
|
17
|
+
rescue Errno::ENOENT
|
18
|
+
require_relative '../elf'
|
19
|
+
|
20
|
+
raise if ELF::INTERPRETER.nil?
|
21
|
+
|
22
|
+
Open3.popen3(ELF::INTERPRETER, *CLI::COMMAND, '--embedded', chdir: __dir__)
|
23
|
+
end
|
24
|
+
|
25
|
+
@stdin.binmode
|
26
|
+
|
27
|
+
Thread.new do
|
28
|
+
Thread.current.name = "sass-embedded-process-stdout-poller-#{@wait_thread.pid}"
|
29
|
+
|
30
|
+
# # https://dart.dev/tools/dart-devtools
|
31
|
+
# if 'dart' == File.basename(CLI::COMMAND.first, '.exe') && CLI::COMMAND.include?('--observe')
|
32
|
+
# Kernel.warn(@stdout.readline, uplevel: 0)
|
33
|
+
# Kernel.warn(@stdout.readline, uplevel: 0)
|
34
|
+
# end
|
35
|
+
|
36
|
+
@stdout.binmode
|
37
|
+
|
38
|
+
loop do
|
39
|
+
length = Varint.read(@stdout)
|
40
|
+
id = Varint.read(@stdout)
|
41
|
+
proto = @stdout.read(length - Varint.length(id))
|
42
|
+
dispatcher.receive_proto(id, proto)
|
43
|
+
end
|
44
|
+
rescue IOError, Errno::EBADF, Errno::EPROTO => e
|
45
|
+
dispatcher.error(e)
|
46
|
+
@mutex.synchronize do
|
47
|
+
@stdout.close
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
Thread.new do
|
52
|
+
Thread.current.name = "sass-embedded-process-stderr-poller-#{@wait_thread.pid}"
|
53
|
+
loop do
|
54
|
+
Kernel.warn(@stderr.readline, uplevel: 0)
|
55
|
+
end
|
56
|
+
rescue IOError, Errno::EBADF
|
57
|
+
@mutex.synchronize do
|
58
|
+
@stderr.close
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
@wait_thread.name = "sass-embedded-process-waiter-#{@wait_thread.pid}"
|
63
|
+
end
|
64
|
+
|
65
|
+
def close
|
66
|
+
@mutex.synchronize do
|
67
|
+
@stdin.close
|
68
|
+
@wait_thread.join
|
69
|
+
@stdout.close
|
70
|
+
@stderr.close
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def closed?
|
75
|
+
@mutex.synchronize do
|
76
|
+
@stdin.closed? && !@wait_thread.alive?
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def write(id, proto)
|
81
|
+
buffer = []
|
82
|
+
Varint.write(buffer, Varint.length(id) + proto.length)
|
83
|
+
Varint.write(buffer, id)
|
84
|
+
@mutex.synchronize do
|
85
|
+
@stdin.write(buffer.pack('C*'), proto)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
private_constant :Connection
|
91
|
+
end
|
92
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Sass
|
4
|
-
class
|
4
|
+
class Compiler
|
5
5
|
# The {Dispatcher} class.
|
6
6
|
#
|
7
7
|
# It dispatches messages between mutliple instances of {Host} and a single {Connection} to the compiler.
|
@@ -11,11 +11,12 @@ module Sass
|
|
11
11
|
@observers = {}
|
12
12
|
@mutex = Mutex.new
|
13
13
|
@connection = Connection.new(self)
|
14
|
+
ForkTracker.add(self)
|
14
15
|
end
|
15
16
|
|
16
17
|
def subscribe(observer)
|
17
18
|
@mutex.synchronize do
|
18
|
-
raise Errno::EBUSY if
|
19
|
+
raise Errno::EBUSY if _closed?
|
19
20
|
|
20
21
|
id = @id
|
21
22
|
@id = id.next
|
@@ -30,12 +31,12 @@ module Sass
|
|
30
31
|
|
31
32
|
return unless @observers.empty?
|
32
33
|
|
33
|
-
if
|
34
|
+
if _closed?
|
34
35
|
Thread.new do
|
35
36
|
close
|
36
37
|
end
|
37
38
|
else
|
38
|
-
|
39
|
+
_idle
|
39
40
|
end
|
40
41
|
end
|
41
42
|
end
|
@@ -45,7 +46,11 @@ module Sass
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def close
|
49
|
+
@mutex.synchronize do
|
50
|
+
_close
|
51
|
+
end
|
48
52
|
@connection.close
|
53
|
+
ForkTracker.delete(self)
|
49
54
|
end
|
50
55
|
|
51
56
|
def closed?
|
@@ -54,7 +59,7 @@ module Sass
|
|
54
59
|
|
55
60
|
def error(error)
|
56
61
|
observers = @mutex.synchronize do
|
57
|
-
|
62
|
+
_close
|
58
63
|
@observers.values
|
59
64
|
end
|
60
65
|
|
@@ -70,12 +75,12 @@ module Sass
|
|
70
75
|
def receive_proto(id, proto)
|
71
76
|
case id
|
72
77
|
when 1...0xffffffff
|
73
|
-
@mutex.synchronize { @observers[id] }
|
78
|
+
@mutex.synchronize { @observers[id] }&.receive_proto(proto)
|
74
79
|
when 0
|
75
80
|
outbound_message = EmbeddedProtocol::OutboundMessage.decode(proto)
|
76
81
|
oneof = outbound_message.message
|
77
82
|
message = outbound_message.public_send(oneof)
|
78
|
-
@mutex.synchronize { @observers[message.id] }
|
83
|
+
@mutex.synchronize { @observers[message.id] }&.public_send(oneof, message)
|
79
84
|
when 0xffffffff
|
80
85
|
outbound_message = EmbeddedProtocol::OutboundMessage.decode(proto)
|
81
86
|
oneof = outbound_message.message
|
@@ -90,6 +95,24 @@ module Sass
|
|
90
95
|
@connection.write(...)
|
91
96
|
end
|
92
97
|
|
98
|
+
private
|
99
|
+
|
100
|
+
def _close
|
101
|
+
@id = 0xffffffff
|
102
|
+
end
|
103
|
+
|
104
|
+
def _closed?
|
105
|
+
@id == 0xffffffff
|
106
|
+
end
|
107
|
+
|
108
|
+
def _idle
|
109
|
+
@id = 1
|
110
|
+
end
|
111
|
+
|
112
|
+
def _idle?
|
113
|
+
@id == 1
|
114
|
+
end
|
115
|
+
|
93
116
|
# The {Channel} between {Dispatcher} and {Host}.
|
94
117
|
class Channel
|
95
118
|
attr_reader :id
|
@@ -104,9 +127,7 @@ module Sass
|
|
104
127
|
end
|
105
128
|
|
106
129
|
def error(...)
|
107
|
-
|
108
|
-
@dispatcher.error(...)
|
109
|
-
end
|
130
|
+
@dispatcher.error(...)
|
110
131
|
end
|
111
132
|
|
112
133
|
def send_proto(...)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Sass
|
4
|
-
class
|
4
|
+
class Compiler
|
5
5
|
class Host
|
6
6
|
# The {FunctionRegistry} class.
|
7
7
|
#
|
@@ -55,8 +55,8 @@ module Sass
|
|
55
55
|
|
56
56
|
EmbeddedProtocol::InboundMessage::FunctionCallResponse.new(
|
57
57
|
id: function_call_request.id,
|
58
|
-
success
|
59
|
-
accessed_argument_lists:
|
58
|
+
success:,
|
59
|
+
accessed_argument_lists:
|
60
60
|
)
|
61
61
|
rescue StandardError => e
|
62
62
|
EmbeddedProtocol::InboundMessage::FunctionCallResponse.new(
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Sass
|
4
|
-
class
|
4
|
+
class Compiler
|
5
5
|
class Host
|
6
6
|
# The {ImporterRegistry} class.
|
7
7
|
#
|
@@ -65,7 +65,7 @@ module Sass
|
|
65
65
|
|
66
66
|
EmbeddedProtocol::InboundMessage::CanonicalizeResponse.new(
|
67
67
|
id: canonicalize_request.id,
|
68
|
-
url:
|
68
|
+
url:
|
69
69
|
)
|
70
70
|
rescue StandardError => e
|
71
71
|
EmbeddedProtocol::InboundMessage::CanonicalizeResponse.new(
|
@@ -100,7 +100,7 @@ module Sass
|
|
100
100
|
|
101
101
|
EmbeddedProtocol::InboundMessage::FileImportResponse.new(
|
102
102
|
id: file_import_request.id,
|
103
|
-
file_url:
|
103
|
+
file_url:
|
104
104
|
)
|
105
105
|
rescue StandardError => e
|
106
106
|
EmbeddedProtocol::InboundMessage::FileImportResponse.new(
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Sass
|
4
|
-
class
|
4
|
+
class Compiler
|
5
5
|
class Host
|
6
6
|
# The {Structifier} module.
|
7
7
|
#
|
@@ -10,14 +10,14 @@ module Sass
|
|
10
10
|
module_function
|
11
11
|
|
12
12
|
def to_struct(obj, *symbols)
|
13
|
-
return obj unless obj.is_a?
|
13
|
+
return obj unless obj.is_a?(Hash)
|
14
14
|
|
15
15
|
struct = Object.new
|
16
16
|
symbols.each do |key|
|
17
17
|
next unless obj.key?(key)
|
18
18
|
|
19
19
|
value = obj[key]
|
20
|
-
if value.respond_to?
|
20
|
+
if value.respond_to?(:call)
|
21
21
|
struct.define_singleton_method key do |*args, **kwargs|
|
22
22
|
value.call(*args, **kwargs)
|
23
23
|
end
|
@@ -8,7 +8,7 @@ require_relative 'host/structifier'
|
|
8
8
|
require_relative 'host/value_protofier'
|
9
9
|
|
10
10
|
module Sass
|
11
|
-
class
|
11
|
+
class Compiler
|
12
12
|
# The {Host} class.
|
13
13
|
#
|
14
14
|
# It communicates with {Dispatcher} and handles the host logic.
|
@@ -35,16 +35,16 @@ module Sass
|
|
35
35
|
quiet_deps:,
|
36
36
|
verbose:)
|
37
37
|
compile_response = await do
|
38
|
-
alert_color =
|
38
|
+
alert_color = Exception.respond_to?(:to_tty?) && Exception.to_tty? if alert_color.nil?
|
39
39
|
|
40
|
-
@function_registry = FunctionRegistry.new(functions, alert_color:
|
41
|
-
@importer_registry = ImporterRegistry.new(importers, load_paths, alert_color:
|
40
|
+
@function_registry = FunctionRegistry.new(functions, alert_color:)
|
41
|
+
@importer_registry = ImporterRegistry.new(importers, load_paths, alert_color:)
|
42
42
|
@logger_registry = LoggerRegistry.new(logger)
|
43
43
|
|
44
44
|
send_message(compile_request: EmbeddedProtocol::InboundMessage::CompileRequest.new(
|
45
45
|
string: unless source.nil?
|
46
46
|
EmbeddedProtocol::InboundMessage::CompileRequest::StringInput.new(
|
47
|
-
source
|
47
|
+
source:,
|
48
48
|
url: url&.to_s,
|
49
49
|
syntax: Protofier.to_proto_syntax(syntax),
|
50
50
|
importer: (@importer_registry.register(importer) unless importer.nil?)
|
@@ -52,15 +52,15 @@ module Sass
|
|
52
52
|
end,
|
53
53
|
path: (File.absolute_path(path) unless path.nil?),
|
54
54
|
style: Protofier.to_proto_output_style(style),
|
55
|
-
charset
|
56
|
-
source_map
|
57
|
-
source_map_include_sources
|
55
|
+
charset:,
|
56
|
+
source_map:,
|
57
|
+
source_map_include_sources:,
|
58
58
|
importers: @importer_registry.importers,
|
59
59
|
global_functions: @function_registry.global_functions,
|
60
|
-
alert_ascii
|
61
|
-
alert_color
|
62
|
-
quiet_deps
|
63
|
-
verbose:
|
60
|
+
alert_ascii:,
|
61
|
+
alert_color:,
|
62
|
+
quiet_deps:,
|
63
|
+
verbose:
|
64
64
|
))
|
65
65
|
end
|
66
66
|
|
@@ -70,7 +70,7 @@ module Sass
|
|
70
70
|
def version_request
|
71
71
|
version_response = await0 do
|
72
72
|
send_message0(version_request: EmbeddedProtocol::InboundMessage::VersionRequest.new(
|
73
|
-
id:
|
73
|
+
id:
|
74
74
|
))
|
75
75
|
end
|
76
76
|
|
@@ -100,6 +100,8 @@ module Sass
|
|
100
100
|
|
101
101
|
def log_event(message)
|
102
102
|
@logger_registry.log(message)
|
103
|
+
rescue StandardError => e
|
104
|
+
@channel.error(e)
|
103
105
|
end
|
104
106
|
|
105
107
|
def canonicalize_request(message)
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Sass
|
4
|
-
class
|
4
|
+
class Compiler
|
5
5
|
# The {ResilientDispatcher} class.
|
6
6
|
#
|
7
7
|
# It recovers from failures and continues to function.
|
8
8
|
class ResilientDispatcher
|
9
|
-
def initialize
|
10
|
-
@
|
9
|
+
def initialize(dispatcher_class)
|
10
|
+
@dispatcher_class = dispatcher_class
|
11
|
+
@dispatcher = @dispatcher_class.new
|
11
12
|
@mutex = Mutex.new
|
12
13
|
end
|
13
14
|
|
@@ -29,7 +30,7 @@ module Sass
|
|
29
30
|
@mutex.synchronize do
|
30
31
|
@dispatcher.connect(...)
|
31
32
|
rescue Errno::EBUSY
|
32
|
-
@dispatcher =
|
33
|
+
@dispatcher = @dispatcher_class.new
|
33
34
|
@dispatcher.connect(...)
|
34
35
|
end
|
35
36
|
end
|