sass-embedded 1.69.6 → 1.69.7
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 +3 -3
- data/ext/sass/package.json +1 -1
- data/lib/sass/calculation_value/calculation_operation.rb +2 -5
- data/lib/sass/calculation_value.rb +10 -4
- data/lib/sass/compiler/dispatcher.rb +1 -1
- data/lib/sass/compiler/{resilient_dispatcher.rb → dispatcher_manager.rb} +13 -10
- data/lib/sass/compiler/host/importer_registry.rb +1 -1
- data/lib/sass/compiler/host/value_protofier.rb +2 -2
- data/lib/sass/compiler/host.rb +9 -2
- data/lib/sass/compiler.rb +6 -3
- data/lib/sass/elf.rb +2 -2
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/embedded.rb +1 -1
- data/lib/sass/exception.rb +1 -1
- data/lib/sass/fork_tracker.rb +1 -1
- data/lib/sass/serializer.rb +22 -54
- data/lib/sass/value/argument_list.rb +1 -1
- data/lib/sass/value/calculation.rb +3 -1
- data/lib/sass/value/function.rb +5 -3
- data/lib/sass/value/string.rb +5 -8
- data/lib/sass/value.rb +1 -8
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ddf58c29aaacc85fb79d2f70cccf60ef11566a7dd961ce4d1b6753580e63be7
|
4
|
+
data.tar.gz: 3f94c4fc1435af31542aba4af84997a0e3628372ead2fe0e61a5eafd35270d76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a8794f30f711b9e5f3c23e93aeff8e2849c194f1774a3125c69d06f71b5e0a195a8b8114701ee27089b7bd5b6ecd922aaaabcc3886577aab0e0c2668c2ddac
|
7
|
+
data.tar.gz: b51d8a8acd12db57a88293a9f8a4b6c0efebc8591e167ae7e3ce56dbf776d1cc0d2e64c980ceb78802356659afc142a9f6128e11e1e3264340074d0aef664acc
|
data/ext/sass/Rakefile
CHANGED
@@ -41,12 +41,12 @@ file 'cli.rb' => %w[dart-sass] do |t|
|
|
41
41
|
|
42
42
|
command = if File.exist?(runtime) && File.exist?(snapshot)
|
43
43
|
"
|
44
|
-
File.absolute_path('#{runtime}', __dir__),
|
45
|
-
File.absolute_path('#{snapshot}', __dir__)
|
44
|
+
File.absolute_path('#{runtime}', __dir__).freeze,
|
45
|
+
File.absolute_path('#{snapshot}', __dir__).freeze
|
46
46
|
"
|
47
47
|
else
|
48
48
|
"
|
49
|
-
File.absolute_path('#{exe}', __dir__)
|
49
|
+
File.absolute_path('#{exe}', __dir__).freeze
|
50
50
|
"
|
51
51
|
end
|
52
52
|
|
data/ext/sass/package.json
CHANGED
@@ -18,12 +18,9 @@ module Sass
|
|
18
18
|
def initialize(operator, left, right)
|
19
19
|
raise Sass::ScriptError, "Invalid operator: #{operator}" unless OPERATORS.include?(operator)
|
20
20
|
|
21
|
-
left.assert_calculation_value
|
22
|
-
right.assert_calculation_value
|
23
|
-
|
24
21
|
@operator = operator.freeze
|
25
|
-
@left = left
|
26
|
-
@right = right
|
22
|
+
@left = assert_calculation_value(left, 'left')
|
23
|
+
@right = assert_calculation_value(right, 'right')
|
27
24
|
end
|
28
25
|
|
29
26
|
# @return [::String]
|
@@ -5,10 +5,16 @@ module Sass
|
|
5
5
|
#
|
6
6
|
# @see https://sass-lang.com/documentation/js-api/types/calculationvalue/
|
7
7
|
module CalculationValue
|
8
|
-
|
9
|
-
|
10
|
-
def assert_calculation_value(
|
11
|
-
|
8
|
+
private
|
9
|
+
|
10
|
+
def assert_calculation_value(value, name = nil)
|
11
|
+
if !value.is_a?(Sass::CalculationValue) || (value.is_a?(Sass::Value::String) && value.quoted?)
|
12
|
+
raise Sass::ScriptError.new(
|
13
|
+
"#{value} must be one of SassNumber, unquoted SassString, SassCalculation, CalculationOperation", name
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
value
|
12
18
|
end
|
13
19
|
end
|
14
20
|
end
|
@@ -2,32 +2,35 @@
|
|
2
2
|
|
3
3
|
module Sass
|
4
4
|
class Compiler
|
5
|
-
# The {
|
5
|
+
# The {DispatcherManager} class.
|
6
6
|
#
|
7
|
-
# It
|
8
|
-
class
|
7
|
+
# It manages the lifecycle of {Dispatcher}.
|
8
|
+
class DispatcherManager
|
9
9
|
def initialize(dispatcher_class)
|
10
10
|
@dispatcher_class = dispatcher_class
|
11
11
|
@dispatcher = @dispatcher_class.new
|
12
12
|
@mutex = Mutex.new
|
13
13
|
end
|
14
14
|
|
15
|
-
def close
|
15
|
+
def close
|
16
16
|
@mutex.synchronize do
|
17
|
-
@dispatcher.
|
17
|
+
unless @dispatcher.nil?
|
18
|
+
@dispatcher.close
|
19
|
+
@dispatcher = nil
|
20
|
+
end
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
21
|
-
def closed?
|
24
|
+
def closed?
|
22
25
|
@mutex.synchronize do
|
23
|
-
@dispatcher.
|
26
|
+
@dispatcher.nil?
|
24
27
|
end
|
25
28
|
end
|
26
29
|
|
27
30
|
def connect(...)
|
28
|
-
@dispatcher.connect(...)
|
29
|
-
rescue Errno::EBUSY
|
30
31
|
@mutex.synchronize do
|
32
|
+
raise IOError, 'closed compiler' if @dispatcher.nil?
|
33
|
+
|
31
34
|
@dispatcher.connect(...)
|
32
35
|
rescue Errno::EBUSY
|
33
36
|
@dispatcher = @dispatcher_class.new
|
@@ -36,6 +39,6 @@ module Sass
|
|
36
39
|
end
|
37
40
|
end
|
38
41
|
|
39
|
-
private_constant :
|
42
|
+
private_constant :DispatcherManager
|
40
43
|
end
|
41
44
|
end
|
@@ -81,7 +81,7 @@ module Sass
|
|
81
81
|
EmbeddedProtocol::InboundMessage::ImportResponse.new(
|
82
82
|
id: import_request.id,
|
83
83
|
success: EmbeddedProtocol::InboundMessage::ImportResponse::ImportSuccess.new(
|
84
|
-
contents: importer_result.contents,
|
84
|
+
contents: importer_result.contents.to_str,
|
85
85
|
syntax: Protofier.to_proto_syntax(importer_result.syntax),
|
86
86
|
source_map_url: (importer_result.source_map_url&.to_s if importer_result.respond_to?(:source_map_url))
|
87
87
|
)
|
@@ -16,7 +16,7 @@ module Sass
|
|
16
16
|
when Sass::Value::String
|
17
17
|
EmbeddedProtocol::Value.new(
|
18
18
|
string: EmbeddedProtocol::Value::String.new(
|
19
|
-
text: obj.text,
|
19
|
+
text: obj.text.to_str,
|
20
20
|
quoted: obj.quoted?
|
21
21
|
)
|
22
22
|
)
|
@@ -179,7 +179,7 @@ module Sass
|
|
179
179
|
end
|
180
180
|
)
|
181
181
|
when :compiler_function
|
182
|
-
Sass::Value::Function.new(nil
|
182
|
+
Sass::Value::Function.new(nil).instance_eval do
|
183
183
|
@id = obj.id
|
184
184
|
self
|
185
185
|
end
|
data/lib/sass/compiler/host.rb
CHANGED
@@ -44,7 +44,7 @@ module Sass
|
|
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: source.to_str,
|
48
48
|
url: url&.to_s,
|
49
49
|
syntax: Protofier.to_proto_syntax(syntax),
|
50
50
|
importer: (@importer_registry.register(importer) unless importer.nil?)
|
@@ -74,7 +74,14 @@ module Sass
|
|
74
74
|
))
|
75
75
|
end
|
76
76
|
|
77
|
-
|
77
|
+
lang = case version_response.implementation_name
|
78
|
+
when /\bdart\b/i
|
79
|
+
'[Dart]'
|
80
|
+
else
|
81
|
+
'[?]'
|
82
|
+
end
|
83
|
+
|
84
|
+
"#{version_response.implementation_name}\t#{version_response.implementation_version}\t(Sass Compiler)\t#{lang}"
|
78
85
|
end
|
79
86
|
|
80
87
|
def compile_response(message)
|
data/lib/sass/compiler.rb
CHANGED
@@ -4,8 +4,8 @@ require_relative 'canonicalize_context'
|
|
4
4
|
require_relative 'compile_result'
|
5
5
|
require_relative 'compiler/connection'
|
6
6
|
require_relative 'compiler/dispatcher'
|
7
|
+
require_relative 'compiler/dispatcher_manager'
|
7
8
|
require_relative 'compiler/host'
|
8
|
-
require_relative 'compiler/resilient_dispatcher'
|
9
9
|
require_relative 'compiler/varint'
|
10
10
|
require_relative 'embedded_protocol'
|
11
11
|
require_relative 'exception'
|
@@ -27,7 +27,7 @@ module Sass
|
|
27
27
|
# sass.close
|
28
28
|
class Compiler
|
29
29
|
def initialize
|
30
|
-
@dispatcher =
|
30
|
+
@dispatcher = DispatcherManager.new(Dispatcher)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Compiles the Sass file at +path+ to CSS.
|
@@ -174,7 +174,10 @@ module Sass
|
|
174
174
|
# @return [String] Information about the Sass implementation.
|
175
175
|
# @see https://sass-lang.com/documentation/js-api/variables/info/
|
176
176
|
def info
|
177
|
-
@info ||=
|
177
|
+
@info ||= <<~INFO.freeze
|
178
|
+
sass-embedded\t#{Embedded::VERSION}\t(Embedded Host)\t[Ruby]
|
179
|
+
#{Host.new(@dispatcher).version_request}
|
180
|
+
INFO
|
178
181
|
end
|
179
182
|
|
180
183
|
def close
|
data/lib/sass/elf.rb
CHANGED
@@ -150,7 +150,7 @@ module Sass
|
|
150
150
|
def initialize(buffer)
|
151
151
|
@buffer = buffer
|
152
152
|
@ehdr = read_ehdr
|
153
|
-
@buffer.seek(@ehdr[:e_phoff],
|
153
|
+
@buffer.seek(@ehdr[:e_phoff], IO::SEEK_SET)
|
154
154
|
@proghdrs = Array.new(@ehdr[:e_phnum]) do
|
155
155
|
read_phdr
|
156
156
|
end
|
@@ -176,7 +176,7 @@ module Sass
|
|
176
176
|
phdr = @proghdrs.find { |p| p[:p_type] == PT_INTERP }
|
177
177
|
return if phdr.nil?
|
178
178
|
|
179
|
-
@buffer.seek(phdr[:p_offset],
|
179
|
+
@buffer.seek(phdr[:p_offset], IO::SEEK_SET)
|
180
180
|
interpreter = @buffer.read(phdr[:p_filesz])
|
181
181
|
raise ArgumentError unless interpreter.end_with?("\0")
|
182
182
|
|
data/lib/sass/embedded.rb
CHANGED
@@ -56,7 +56,7 @@ module Sass
|
|
56
56
|
|
57
57
|
compiler = Class.new(Compiler) do
|
58
58
|
def initialize
|
59
|
-
@dispatcher = Compiler.const_get(:
|
59
|
+
@dispatcher = Compiler.const_get(:DispatcherManager).new(Class.new(Compiler.const_get(:Dispatcher)) do
|
60
60
|
def initialize
|
61
61
|
super
|
62
62
|
|
data/lib/sass/exception.rb
CHANGED
data/lib/sass/fork_tracker.rb
CHANGED
data/lib/sass/serializer.rb
CHANGED
@@ -5,67 +5,35 @@ module Sass
|
|
5
5
|
module Serializer
|
6
6
|
module_function
|
7
7
|
|
8
|
-
def
|
9
|
-
|
10
|
-
include_single_quote = false
|
11
|
-
buffer = [34]
|
8
|
+
def serialize_quoted_string(string, ascii_only: false)
|
9
|
+
buffer = [0x22]
|
12
10
|
string.each_codepoint do |codepoint|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
buffer <<
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
buffer <<
|
26
|
-
|
27
|
-
buffer <<
|
11
|
+
if codepoint.zero?
|
12
|
+
# If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
|
13
|
+
buffer << 0xFFFD
|
14
|
+
elsif codepoint == 0x22
|
15
|
+
# If the character is '"' (U+0022) or "\" (U+005C), then the escaped character.
|
16
|
+
buffer << 0x5C << 0x22
|
17
|
+
elsif codepoint == 0x5C
|
18
|
+
# If the character is '"' (U+0022) or "\" (U+005C), then the escaped character.
|
19
|
+
buffer << 0x5C << 0x5C
|
20
|
+
elsif codepoint < 0x20 || (ascii_only ? codepoint >= 0x7F : codepoint == 0x7F)
|
21
|
+
# If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
|
22
|
+
# then the character escaped as code point.
|
23
|
+
buffer << 0x5C
|
24
|
+
buffer.concat(codepoint.to_s(16).codepoints)
|
25
|
+
buffer << 0x20
|
28
26
|
else
|
29
|
-
|
30
|
-
|
31
|
-
buffer.concat(codepoint.to_s(16).codepoints)
|
32
|
-
buffer << 32
|
33
|
-
else
|
34
|
-
buffer << codepoint
|
35
|
-
end
|
27
|
+
# Otherwise, the character itself.
|
28
|
+
buffer << codepoint
|
36
29
|
end
|
37
30
|
end
|
38
|
-
|
39
|
-
buffer[0] = 39
|
40
|
-
buffer << 39
|
41
|
-
else
|
42
|
-
buffer << 34
|
43
|
-
end
|
31
|
+
buffer << 0x22
|
44
32
|
buffer.pack('U*')
|
45
33
|
end
|
46
34
|
|
47
|
-
def
|
48
|
-
|
49
|
-
string.each_codepoint do |codepoint|
|
50
|
-
case codepoint
|
51
|
-
when 34
|
52
|
-
buffer << 92 << 34
|
53
|
-
when 92
|
54
|
-
buffer << 92 << 92
|
55
|
-
when 9
|
56
|
-
buffer << 9
|
57
|
-
else
|
58
|
-
if codepoint < 32 || codepoint > 126
|
59
|
-
buffer << 92
|
60
|
-
buffer.concat(codepoint.to_s(16).codepoints)
|
61
|
-
buffer << 32
|
62
|
-
else
|
63
|
-
buffer << codepoint
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
buffer << 34
|
68
|
-
buffer.pack('U*')
|
35
|
+
def serialize_unquoted_string(string)
|
36
|
+
string.tr("\0", "\uFFFD").gsub(/\n */, ' ')
|
69
37
|
end
|
70
38
|
end
|
71
39
|
|
@@ -8,7 +8,7 @@ module Sass
|
|
8
8
|
# map as well as the positional arguments.
|
9
9
|
#
|
10
10
|
# @see https://sass-lang.com/documentation/js-api/classes/sassargumentlist/
|
11
|
-
class ArgumentList <
|
11
|
+
class ArgumentList < List
|
12
12
|
# @param contents [Array<Value>]
|
13
13
|
# @param keywords [Hash<::String, Value>]
|
14
14
|
# @param separator [::String]
|
data/lib/sass/value/function.rb
CHANGED
@@ -10,9 +10,11 @@ module Sass
|
|
10
10
|
|
11
11
|
# @param signature [::String]
|
12
12
|
# @param callback [Proc]
|
13
|
-
def initialize(signature, callback)
|
14
|
-
|
15
|
-
|
13
|
+
def initialize(signature, &callback)
|
14
|
+
raise Sass::ScriptError, 'no block given' unless signature.nil? || callback
|
15
|
+
|
16
|
+
@signature = signature.freeze
|
17
|
+
@callback = callback.freeze
|
16
18
|
end
|
17
19
|
|
18
20
|
# @return [Integer, nil]
|
data/lib/sass/value/string.rb
CHANGED
@@ -39,14 +39,6 @@ module Sass
|
|
39
39
|
self
|
40
40
|
end
|
41
41
|
|
42
|
-
# @return [CalculationValue]
|
43
|
-
# @raise [ScriptError]
|
44
|
-
def assert_calculation_value(name = nil)
|
45
|
-
raise Sass::ScriptError.new("Expected #{self} to be an unquoted string.", name) if quoted?
|
46
|
-
|
47
|
-
self
|
48
|
-
end
|
49
|
-
|
50
42
|
# @param sass_index [Number]
|
51
43
|
# @return [Integer]
|
52
44
|
def sass_index_to_string_index(sass_index, name = nil)
|
@@ -59,6 +51,11 @@ module Sass
|
|
59
51
|
|
60
52
|
index.negative? ? text.length + index : index - 1
|
61
53
|
end
|
54
|
+
|
55
|
+
# @return [String]
|
56
|
+
def to_s
|
57
|
+
@quoted ? Serializer.serialize_quoted_string(@text) : Serializer.serialize_unquoted_string(@text)
|
58
|
+
end
|
62
59
|
end
|
63
60
|
end
|
64
61
|
end
|
data/lib/sass/value.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative 'calculation_value'
|
4
|
-
|
5
3
|
module Sass
|
6
4
|
# The abstract base class of Sass's value types.
|
7
5
|
#
|
@@ -66,12 +64,6 @@ module Sass
|
|
66
64
|
raise Sass::ScriptError.new("#{self} is not a calculation", name)
|
67
65
|
end
|
68
66
|
|
69
|
-
# @return [CalculationValue]
|
70
|
-
# @raise [ScriptError]
|
71
|
-
def assert_calculation_value(name = nil)
|
72
|
-
raise Sass::ScriptError.new("#{self} is not a calculation value", name)
|
73
|
-
end
|
74
|
-
|
75
67
|
# @return [Color]
|
76
68
|
# @raise [ScriptError]
|
77
69
|
def assert_color(name = nil)
|
@@ -129,6 +121,7 @@ module Sass
|
|
129
121
|
end
|
130
122
|
end
|
131
123
|
|
124
|
+
require_relative 'calculation_value'
|
132
125
|
require_relative 'value/list'
|
133
126
|
require_relative 'value/argument_list'
|
134
127
|
require_relative 'value/boolean'
|
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.69.
|
4
|
+
version: 1.69.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- lib/sass/compiler.rb
|
64
64
|
- lib/sass/compiler/connection.rb
|
65
65
|
- lib/sass/compiler/dispatcher.rb
|
66
|
+
- lib/sass/compiler/dispatcher_manager.rb
|
66
67
|
- lib/sass/compiler/host.rb
|
67
68
|
- lib/sass/compiler/host/function_registry.rb
|
68
69
|
- lib/sass/compiler/host/importer_registry.rb
|
@@ -70,7 +71,6 @@ files:
|
|
70
71
|
- lib/sass/compiler/host/protofier.rb
|
71
72
|
- lib/sass/compiler/host/structifier.rb
|
72
73
|
- lib/sass/compiler/host/value_protofier.rb
|
73
|
-
- lib/sass/compiler/resilient_dispatcher.rb
|
74
74
|
- lib/sass/compiler/varint.rb
|
75
75
|
- lib/sass/elf.rb
|
76
76
|
- lib/sass/embedded.rb
|
@@ -100,9 +100,10 @@ homepage: https://github.com/sass-contrib/sass-embedded-host-ruby
|
|
100
100
|
licenses:
|
101
101
|
- MIT
|
102
102
|
metadata:
|
103
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.69.
|
104
|
-
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.69.
|
103
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.69.7
|
104
|
+
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.69.7
|
105
105
|
funding_uri: https://github.com/sponsors/ntkme
|
106
|
+
rubygems_mfa_required: 'true'
|
106
107
|
post_install_message:
|
107
108
|
rdoc_options: []
|
108
109
|
require_paths:
|