sass-embedded 1.69.5-x86-linux-gnu → 1.69.6-x86-linux-gnu
Sign up to get free protection for your applications and to get access to all the features.
- 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 +1 -1
- 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 -204
- 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/number.rb +8 -8
- 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 -71
- data/lib/sass/script_error.rb +0 -10
data/lib/sass/embedded.rb
CHANGED
@@ -1,19 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
4
|
-
require_relative 'compile_error'
|
5
|
-
require_relative 'compile_result'
|
6
|
-
require_relative 'embedded/connection'
|
7
|
-
require_relative 'embedded/dispatcher'
|
8
|
-
require_relative 'embedded/host'
|
9
|
-
require_relative 'embedded/resilient_dispatcher'
|
10
|
-
require_relative 'embedded/varint'
|
3
|
+
require_relative 'compiler'
|
11
4
|
require_relative 'embedded/version'
|
12
|
-
require_relative 'embedded_protocol'
|
13
|
-
require_relative 'logger/silent'
|
14
|
-
require_relative 'logger/source_location'
|
15
|
-
require_relative 'logger/source_span'
|
16
|
-
require_relative 'value'
|
17
5
|
|
18
6
|
# The Sass module.
|
19
7
|
#
|
@@ -25,223 +13,96 @@ require_relative 'value'
|
|
25
13
|
# @example
|
26
14
|
# Sass.compile_string('h1 { font-size: 40px; }')
|
27
15
|
module Sass
|
28
|
-
@
|
16
|
+
@compiler = nil
|
29
17
|
@mutex = Mutex.new
|
30
18
|
|
31
19
|
# rubocop:disable Layout/LineLength
|
32
20
|
class << self
|
33
21
|
# Compiles the Sass file at +path+ to CSS.
|
34
22
|
# @overload compile(path, load_paths: [], charset: true, source_map: false, source_map_include_sources: false, style: :expanded, functions: {}, importers: [], alert_ascii: false, alert_color: nil, logger: nil, quiet_deps: false, verbose: false)
|
35
|
-
# @param (see
|
36
|
-
# @return (see
|
37
|
-
# @raise (see
|
38
|
-
# @see
|
23
|
+
# @param (see Compiler#compile)
|
24
|
+
# @return (see Compiler#compile)
|
25
|
+
# @raise (see Compiler#compile)
|
26
|
+
# @see Compiler#compile
|
39
27
|
def compile(...)
|
40
|
-
|
28
|
+
compiler.compile(...)
|
41
29
|
end
|
42
30
|
|
43
31
|
# Compiles a stylesheet whose contents is +source+ to CSS.
|
44
32
|
# @overload compile_string(source, importer: nil, load_paths: [], syntax: :scss, url: nil, charset: true, source_map: false, source_map_include_sources: false, style: :expanded, functions: {}, importers: [], alert_ascii: false, alert_color: nil, logger: nil, quiet_deps: false, verbose: false)
|
45
|
-
# @param (see
|
46
|
-
# @return (see
|
47
|
-
# @raise (see
|
48
|
-
# @see
|
33
|
+
# @param (see Compiler#compile_string)
|
34
|
+
# @return (see Compiler#compile_string)
|
35
|
+
# @raise (see Compiler#compile_string)
|
36
|
+
# @see Compiler#compile_string
|
49
37
|
def compile_string(...)
|
50
|
-
|
38
|
+
compiler.compile_string(...)
|
51
39
|
end
|
52
40
|
|
53
|
-
# @param (see
|
54
|
-
# @return (see
|
55
|
-
# @raise (see
|
56
|
-
# @see
|
41
|
+
# @param (see Compiler#info)
|
42
|
+
# @return (see Compiler#info)
|
43
|
+
# @raise (see Compiler#info)
|
44
|
+
# @see Compiler#info
|
57
45
|
def info
|
58
|
-
|
46
|
+
compiler.info
|
59
47
|
end
|
60
48
|
|
61
49
|
private
|
62
50
|
|
63
|
-
def
|
64
|
-
return @
|
51
|
+
def compiler
|
52
|
+
return @compiler if @compiler
|
65
53
|
|
66
54
|
@mutex.synchronize do
|
67
|
-
return @
|
55
|
+
return @compiler if @compiler
|
56
|
+
|
57
|
+
compiler = Class.new(Compiler) do
|
58
|
+
def initialize
|
59
|
+
@dispatcher = Compiler.const_get(:ResilientDispatcher).new(Class.new(Compiler.const_get(:Dispatcher)) do
|
60
|
+
def initialize
|
61
|
+
super
|
62
|
+
|
63
|
+
idle_timeout = 10
|
64
|
+
@last_accessed_time = current_time
|
65
|
+
|
66
|
+
Thread.new do
|
67
|
+
Thread.current.name = 'sass-embedded-process-reaper'
|
68
|
+
duration = idle_timeout
|
69
|
+
loop do
|
70
|
+
sleep(duration.negative? ? idle_timeout : duration)
|
71
|
+
break if @mutex.synchronize do
|
72
|
+
raise Errno::EBUSY if _closed?
|
73
|
+
|
74
|
+
duration = idle_timeout - (current_time - @last_accessed_time)
|
75
|
+
duration.negative? && _idle? && _close
|
76
|
+
end
|
77
|
+
end
|
78
|
+
close
|
79
|
+
rescue Errno::EBUSY
|
80
|
+
# do nothing
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
def _idle
|
87
|
+
super
|
88
|
+
|
89
|
+
@last_accessed_time = current_time
|
90
|
+
end
|
91
|
+
|
92
|
+
def current_time
|
93
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
94
|
+
end
|
95
|
+
end)
|
96
|
+
end
|
97
|
+
end.new
|
68
98
|
|
69
|
-
@instance = Embedded.new
|
70
99
|
at_exit do
|
71
|
-
|
100
|
+
compiler.close
|
72
101
|
end
|
73
|
-
|
102
|
+
|
103
|
+
@compiler = compiler
|
74
104
|
end
|
75
105
|
end
|
76
106
|
end
|
77
107
|
# rubocop:enable Layout/LineLength
|
78
|
-
|
79
|
-
# The {Embedded} host for using dart-sass. Each instance creates its own
|
80
|
-
# communication {Dispatcher} with a dedicated compiler process.
|
81
|
-
#
|
82
|
-
# @example
|
83
|
-
# embedded = Sass::Embedded.new
|
84
|
-
# result = embedded.compile_string('h1 { font-size: 40px; }')
|
85
|
-
# result = embedded.compile('style.scss')
|
86
|
-
# embedded.close
|
87
|
-
class Embedded
|
88
|
-
def initialize
|
89
|
-
@dispatcher = ResilientDispatcher.new
|
90
|
-
end
|
91
|
-
|
92
|
-
# Compiles the Sass file at +path+ to CSS.
|
93
|
-
# @param path [String]
|
94
|
-
# @param load_paths [Array<String>] Paths in which to look for stylesheets loaded by rules like
|
95
|
-
# {@use}[https://sass-lang.com/documentation/at-rules/use/] and {@import}[https://sass-lang.com/documentation/at-rules/import/].
|
96
|
-
# @param charset [Boolean] By default, if the CSS document contains non-ASCII characters, Sass adds a +@charset+
|
97
|
-
# declaration (in expanded output mode) or a byte-order mark (in compressed mode) to indicate its encoding to
|
98
|
-
# browsers or other consumers. If +charset+ is +false+, these annotations are omitted.
|
99
|
-
# @param source_map [Boolean] Whether or not Sass should generate a source map.
|
100
|
-
# @param source_map_include_sources [Boolean] Whether Sass should include the sources in the generated source map.
|
101
|
-
# @param style [String, Symbol] The OutputStyle of the compiled CSS.
|
102
|
-
# @param functions [Hash<String, Proc>] Additional built-in Sass functions that are available in all stylesheets.
|
103
|
-
# @param importers [Array<Object>] Custom importers that control how Sass resolves loads from rules like
|
104
|
-
# {@use}[https://sass-lang.com/documentation/at-rules/use/] and {@import}[https://sass-lang.com/documentation/at-rules/import/].
|
105
|
-
# @param alert_ascii [Boolean] If this is +true+, the compiler will exclusively use ASCII characters in its error
|
106
|
-
# and warning messages. Otherwise, it may use non-ASCII Unicode characters as well.
|
107
|
-
# @param alert_color [Boolean] If this is +true+, the compiler will use ANSI color escape codes in its error and
|
108
|
-
# warning messages. If it's +false+, it won't use these. If it's +nil+, the compiler will determine whether or
|
109
|
-
# not to use colors depending on whether the user is using an interactive terminal.
|
110
|
-
# @param logger [Object] An object to use to handle warnings and/or debug messages from Sass.
|
111
|
-
# @param quiet_deps [Boolean] If this option is set to +true+, Sass won’t print warnings that are caused by
|
112
|
-
# dependencies. A “dependency” is defined as any file that’s loaded through +load_paths+ or +importer+.
|
113
|
-
# Stylesheets that are imported relative to the entrypoint are not considered dependencies.
|
114
|
-
# @param verbose [Boolean] By default, Dart Sass will print only five instances of the same deprecation warning per
|
115
|
-
# compilation to avoid deluging users in console noise. If you set verbose to +true+, it will instead print every
|
116
|
-
# deprecation warning it encounters.
|
117
|
-
# @return [CompileResult]
|
118
|
-
# @raise [ArgumentError, CompileError]
|
119
|
-
# @see https://sass-lang.com/documentation/js-api/functions/compile/
|
120
|
-
def compile(path,
|
121
|
-
load_paths: [],
|
122
|
-
|
123
|
-
charset: true,
|
124
|
-
source_map: false,
|
125
|
-
source_map_include_sources: false,
|
126
|
-
style: :expanded,
|
127
|
-
|
128
|
-
functions: {},
|
129
|
-
importers: [],
|
130
|
-
|
131
|
-
alert_ascii: false,
|
132
|
-
alert_color: nil,
|
133
|
-
logger: nil,
|
134
|
-
quiet_deps: false,
|
135
|
-
verbose: false)
|
136
|
-
raise ArgumentError, 'path must be set' if path.nil?
|
137
|
-
|
138
|
-
Host.new(@dispatcher).compile_request(
|
139
|
-
path: path,
|
140
|
-
source: nil,
|
141
|
-
importer: nil,
|
142
|
-
load_paths: load_paths,
|
143
|
-
syntax: nil,
|
144
|
-
url: nil,
|
145
|
-
charset: charset,
|
146
|
-
source_map: source_map,
|
147
|
-
source_map_include_sources: source_map_include_sources,
|
148
|
-
style: style,
|
149
|
-
functions: functions,
|
150
|
-
importers: importers,
|
151
|
-
alert_color: alert_color,
|
152
|
-
alert_ascii: alert_ascii,
|
153
|
-
logger: logger,
|
154
|
-
quiet_deps: quiet_deps,
|
155
|
-
verbose: verbose
|
156
|
-
)
|
157
|
-
end
|
158
|
-
|
159
|
-
# Compiles a stylesheet whose contents is +source+ to CSS.
|
160
|
-
# @param source [String]
|
161
|
-
# @param importer [Object] The importer to use to handle loads that are relative to the entrypoint stylesheet.
|
162
|
-
# @param load_paths [Array<String>] Paths in which to look for stylesheets loaded by rules like
|
163
|
-
# {@use}[https://sass-lang.com/documentation/at-rules/use/] and {@import}[https://sass-lang.com/documentation/at-rules/import/].
|
164
|
-
# @param syntax [String, Symbol] The Syntax to use to parse the entrypoint stylesheet.
|
165
|
-
# @param url [String] The canonical URL of the entrypoint stylesheet. If this is passed along with +importer+, it's
|
166
|
-
# used to resolve relative loads in the entrypoint stylesheet.
|
167
|
-
# @param charset [Boolean] By default, if the CSS document contains non-ASCII characters, Sass adds a +@charset+
|
168
|
-
# declaration (in expanded output mode) or a byte-order mark (in compressed mode) to indicate its encoding to
|
169
|
-
# browsers or other consumers. If +charset+ is +false+, these annotations are omitted.
|
170
|
-
# @param source_map [Boolean] Whether or not Sass should generate a source map.
|
171
|
-
# @param source_map_include_sources [Boolean] Whether Sass should include the sources in the generated source map.
|
172
|
-
# @param style [String, Symbol] The OutputStyle of the compiled CSS.
|
173
|
-
# @param functions [Hash<String, Proc>] Additional built-in Sass functions that are available in all stylesheets.
|
174
|
-
# @param importers [Array<Object>] Custom importers that control how Sass resolves loads from rules like
|
175
|
-
# {@use}[https://sass-lang.com/documentation/at-rules/use/] and {@import}[https://sass-lang.com/documentation/at-rules/import/].
|
176
|
-
# @param alert_ascii [Boolean] If this is +true+, the compiler will exclusively use ASCII characters in its error
|
177
|
-
# and warning messages. Otherwise, it may use non-ASCII Unicode characters as well.
|
178
|
-
# @param alert_color [Boolean] If this is +true+, the compiler will use ANSI color escape codes in its error and
|
179
|
-
# warning messages. If it's +false+, it won't use these. If it's +nil+, the compiler will determine whether or
|
180
|
-
# not to use colors depending on whether the user is using an interactive terminal.
|
181
|
-
# @param logger [Object] An object to use to handle warnings and/or debug messages from Sass.
|
182
|
-
# @param quiet_deps [Boolean] If this option is set to +true+, Sass won’t print warnings that are caused by
|
183
|
-
# dependencies. A “dependency” is defined as any file that’s loaded through +load_paths+ or +importer+.
|
184
|
-
# Stylesheets that are imported relative to the entrypoint are not considered dependencies.
|
185
|
-
# @param verbose [Boolean] By default, Dart Sass will print only five instances of the same deprecation warning per
|
186
|
-
# compilation to avoid deluging users in console noise. If you set verbose to +true+, it will instead print every
|
187
|
-
# deprecation warning it encounters.
|
188
|
-
# @return [CompileResult]
|
189
|
-
# @raise [ArgumentError, CompileError]
|
190
|
-
# @see https://sass-lang.com/documentation/js-api/functions/compilestring/
|
191
|
-
def compile_string(source,
|
192
|
-
importer: nil,
|
193
|
-
load_paths: [],
|
194
|
-
syntax: :scss,
|
195
|
-
url: nil,
|
196
|
-
|
197
|
-
charset: true,
|
198
|
-
source_map: false,
|
199
|
-
source_map_include_sources: false,
|
200
|
-
style: :expanded,
|
201
|
-
|
202
|
-
functions: {},
|
203
|
-
importers: [],
|
204
|
-
|
205
|
-
alert_ascii: false,
|
206
|
-
alert_color: nil,
|
207
|
-
logger: nil,
|
208
|
-
quiet_deps: false,
|
209
|
-
verbose: false)
|
210
|
-
raise ArgumentError, 'source must be set' if source.nil?
|
211
|
-
|
212
|
-
Host.new(@dispatcher).compile_request(
|
213
|
-
path: nil,
|
214
|
-
source: source,
|
215
|
-
importer: importer,
|
216
|
-
load_paths: load_paths,
|
217
|
-
syntax: syntax,
|
218
|
-
url: url,
|
219
|
-
charset: charset,
|
220
|
-
source_map: source_map,
|
221
|
-
source_map_include_sources: source_map_include_sources,
|
222
|
-
style: style,
|
223
|
-
functions: functions,
|
224
|
-
importers: importers,
|
225
|
-
alert_color: alert_color,
|
226
|
-
alert_ascii: alert_ascii,
|
227
|
-
logger: logger,
|
228
|
-
quiet_deps: quiet_deps,
|
229
|
-
verbose: verbose
|
230
|
-
)
|
231
|
-
end
|
232
|
-
|
233
|
-
# @return [String] Information about the Sass implementation.
|
234
|
-
# @see https://sass-lang.com/documentation/js-api/variables/info/
|
235
|
-
def info
|
236
|
-
@info ||= Host.new(@dispatcher).version_request
|
237
|
-
end
|
238
|
-
|
239
|
-
def close
|
240
|
-
@dispatcher.close
|
241
|
-
end
|
242
|
-
|
243
|
-
def closed?
|
244
|
-
@dispatcher.closed?
|
245
|
-
end
|
246
|
-
end
|
247
108
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# An exception thrown because a Sass compilation failed.
|
5
|
+
class CompileError < StandardError
|
6
|
+
# @return [String, nil]
|
7
|
+
attr_reader :sass_stack
|
8
|
+
|
9
|
+
# @return [Logger::SourceSpan, nil]
|
10
|
+
attr_reader :span
|
11
|
+
|
12
|
+
# @return [Array<String>]
|
13
|
+
attr_reader :loaded_urls
|
14
|
+
|
15
|
+
# @!visibility private
|
16
|
+
def initialize(message, full_message, sass_stack, span, loaded_urls)
|
17
|
+
super(message)
|
18
|
+
|
19
|
+
@full_message = full_message
|
20
|
+
@sass_stack = sass_stack
|
21
|
+
@span = span
|
22
|
+
@loaded_urls = loaded_urls
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [String]
|
26
|
+
def full_message(highlight: nil, order: nil, **)
|
27
|
+
return super if @full_message.nil?
|
28
|
+
|
29
|
+
highlight = Exception.respond_to?(:to_tty?) && Exception.to_tty? if highlight.nil?
|
30
|
+
if highlight
|
31
|
+
+@full_message
|
32
|
+
else
|
33
|
+
@full_message.gsub(/\e\[[0-9;]*m/, '')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [String]
|
38
|
+
def to_css
|
39
|
+
content = full_message(highlight: false, order: :top)
|
40
|
+
|
41
|
+
<<~CSS
|
42
|
+
/* #{content.gsub('*/', "*\u2060/").gsub("\r\n", "\n").split("\n").join("\n * ")} */
|
43
|
+
|
44
|
+
body::before {
|
45
|
+
position: static;
|
46
|
+
display: block;
|
47
|
+
padding: 1em;
|
48
|
+
margin: 0 0 1em;
|
49
|
+
border-width: 0 0 2px;
|
50
|
+
border-bottom-style: solid;
|
51
|
+
font-family: monospace, monospace;
|
52
|
+
white-space: pre;
|
53
|
+
content: #{Serializer.dump_quoted_string(content)};
|
54
|
+
}
|
55
|
+
CSS
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# An exception thrown by Sass Script.
|
60
|
+
class ScriptError < StandardError
|
61
|
+
def initialize(message, name = nil)
|
62
|
+
super(name.nil? ? message : "$#{name}: #{message}")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# The {ForkTracker} module.
|
5
|
+
#
|
6
|
+
# It tracks objects that need to be closed after `Process.fork`.
|
7
|
+
module ForkTracker
|
8
|
+
HASH = {}.compare_by_identity
|
9
|
+
|
10
|
+
MUTEX = Mutex.new
|
11
|
+
|
12
|
+
private_constant :HASH, :MUTEX
|
13
|
+
|
14
|
+
module_function
|
15
|
+
|
16
|
+
def add(obj)
|
17
|
+
MUTEX.synchronize do
|
18
|
+
HASH[obj] = true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def delete(obj)
|
23
|
+
MUTEX.synchronize do
|
24
|
+
HASH.delete(obj)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def each(...)
|
29
|
+
MUTEX.synchronize do
|
30
|
+
HASH.keys
|
31
|
+
end.each(...)
|
32
|
+
end
|
33
|
+
|
34
|
+
# The {CoreExt} module.
|
35
|
+
#
|
36
|
+
# It closes objects after `Process.fork`.
|
37
|
+
module CoreExt
|
38
|
+
def _fork
|
39
|
+
pid = super
|
40
|
+
ForkTracker.each(&:close) if pid.zero?
|
41
|
+
pid
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
private_constant :CoreExt
|
46
|
+
|
47
|
+
Process.singleton_class.prepend(CoreExt)
|
48
|
+
end
|
49
|
+
|
50
|
+
private_constant :ForkTracker
|
51
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
# The {Serializer} module.
|
5
|
+
module Serializer
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def dump_quoted_string(string)
|
9
|
+
include_double_quote = false
|
10
|
+
include_single_quote = false
|
11
|
+
buffer = [34]
|
12
|
+
string.each_codepoint do |codepoint|
|
13
|
+
case codepoint
|
14
|
+
when 34
|
15
|
+
return dump_double_quoted_string(string) if include_single_quote
|
16
|
+
|
17
|
+
include_double_quote = true
|
18
|
+
buffer << 34
|
19
|
+
when 39
|
20
|
+
return dump_double_quoted_string(string) if include_double_quote
|
21
|
+
|
22
|
+
include_single_quote = true
|
23
|
+
buffer << 39
|
24
|
+
when 92
|
25
|
+
buffer << 92 << 92
|
26
|
+
when 9
|
27
|
+
buffer << 9
|
28
|
+
else
|
29
|
+
if codepoint < 32 || codepoint > 126
|
30
|
+
buffer << 92
|
31
|
+
buffer.concat(codepoint.to_s(16).codepoints)
|
32
|
+
buffer << 32
|
33
|
+
else
|
34
|
+
buffer << codepoint
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
if include_double_quote
|
39
|
+
buffer[0] = 39
|
40
|
+
buffer << 39
|
41
|
+
else
|
42
|
+
buffer << 34
|
43
|
+
end
|
44
|
+
buffer.pack('U*')
|
45
|
+
end
|
46
|
+
|
47
|
+
def dump_double_quoted_string(string)
|
48
|
+
buffer = [34]
|
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*')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private_constant :Serializer
|
73
|
+
end
|
@@ -13,7 +13,7 @@ module Sass
|
|
13
13
|
# @param keywords [Hash<::String, Value>]
|
14
14
|
# @param separator [::String]
|
15
15
|
def initialize(contents = [], keywords = {}, separator = ',')
|
16
|
-
super(contents, separator:
|
16
|
+
super(contents, separator:)
|
17
17
|
|
18
18
|
@id = 0
|
19
19
|
@keywords_accessed = false
|
data/lib/sass/value/number.rb
CHANGED
@@ -183,7 +183,7 @@ module Sass
|
|
183
183
|
def convert_value(new_numerator_units, new_denominator_units, name = nil)
|
184
184
|
coerce_or_convert_value(new_numerator_units, new_denominator_units,
|
185
185
|
coerce_unitless: false,
|
186
|
-
name:
|
186
|
+
name:)
|
187
187
|
end
|
188
188
|
|
189
189
|
# @param other [Number]
|
@@ -200,9 +200,9 @@ module Sass
|
|
200
200
|
def convert_value_to_match(other, name = nil, other_name = nil)
|
201
201
|
coerce_or_convert_value(other.numerator_units, other.denominator_units,
|
202
202
|
coerce_unitless: false,
|
203
|
-
name
|
204
|
-
other
|
205
|
-
other_name:
|
203
|
+
name:,
|
204
|
+
other:,
|
205
|
+
other_name:)
|
206
206
|
end
|
207
207
|
|
208
208
|
# @param new_numerator_units [Array<::String>]
|
@@ -221,7 +221,7 @@ module Sass
|
|
221
221
|
def coerce_value(new_numerator_units, new_denominator_units, name = nil)
|
222
222
|
coerce_or_convert_value(new_numerator_units, new_denominator_units,
|
223
223
|
coerce_unitless: true,
|
224
|
-
name:
|
224
|
+
name:)
|
225
225
|
end
|
226
226
|
|
227
227
|
# @param unit [::String]
|
@@ -244,9 +244,9 @@ module Sass
|
|
244
244
|
def coerce_value_to_match(other, name = nil, other_name = nil)
|
245
245
|
coerce_or_convert_value(other.numerator_units, other.denominator_units,
|
246
246
|
coerce_unitless: true,
|
247
|
-
name
|
248
|
-
other
|
249
|
-
other_name:
|
247
|
+
name:,
|
248
|
+
other:,
|
249
|
+
other_name:)
|
250
250
|
end
|
251
251
|
|
252
252
|
# @return [Number]
|
data/lib/sass/value.rb
CHANGED
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.6
|
5
5
|
platform: x86-linux-gnu
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.25'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.25'
|
27
27
|
description: A Ruby library that will communicate with Embedded Dart Sass using the
|
28
28
|
Embedded Sass protocol.
|
29
29
|
email:
|
@@ -46,27 +46,29 @@ files:
|
|
46
46
|
- lib/sass/calculation_value.rb
|
47
47
|
- lib/sass/calculation_value/calculation_operation.rb
|
48
48
|
- lib/sass/canonicalize_context.rb
|
49
|
-
- lib/sass/compile_error.rb
|
50
49
|
- lib/sass/compile_result.rb
|
50
|
+
- lib/sass/compiler.rb
|
51
|
+
- lib/sass/compiler/connection.rb
|
52
|
+
- lib/sass/compiler/dispatcher.rb
|
53
|
+
- lib/sass/compiler/host.rb
|
54
|
+
- lib/sass/compiler/host/function_registry.rb
|
55
|
+
- lib/sass/compiler/host/importer_registry.rb
|
56
|
+
- lib/sass/compiler/host/logger_registry.rb
|
57
|
+
- lib/sass/compiler/host/protofier.rb
|
58
|
+
- lib/sass/compiler/host/structifier.rb
|
59
|
+
- lib/sass/compiler/host/value_protofier.rb
|
60
|
+
- lib/sass/compiler/resilient_dispatcher.rb
|
61
|
+
- lib/sass/compiler/varint.rb
|
51
62
|
- lib/sass/elf.rb
|
52
63
|
- lib/sass/embedded.rb
|
53
|
-
- lib/sass/embedded/connection.rb
|
54
|
-
- lib/sass/embedded/dispatcher.rb
|
55
|
-
- lib/sass/embedded/host.rb
|
56
|
-
- lib/sass/embedded/host/function_registry.rb
|
57
|
-
- lib/sass/embedded/host/importer_registry.rb
|
58
|
-
- lib/sass/embedded/host/logger_registry.rb
|
59
|
-
- lib/sass/embedded/host/protofier.rb
|
60
|
-
- lib/sass/embedded/host/structifier.rb
|
61
|
-
- lib/sass/embedded/host/value_protofier.rb
|
62
|
-
- lib/sass/embedded/resilient_dispatcher.rb
|
63
|
-
- lib/sass/embedded/varint.rb
|
64
64
|
- lib/sass/embedded/version.rb
|
65
65
|
- lib/sass/embedded_protocol.rb
|
66
|
+
- lib/sass/exception.rb
|
67
|
+
- lib/sass/fork_tracker.rb
|
66
68
|
- lib/sass/logger/silent.rb
|
67
69
|
- lib/sass/logger/source_location.rb
|
68
70
|
- lib/sass/logger/source_span.rb
|
69
|
-
- lib/sass/
|
71
|
+
- lib/sass/serializer.rb
|
70
72
|
- lib/sass/value.rb
|
71
73
|
- lib/sass/value/argument_list.rb
|
72
74
|
- lib/sass/value/boolean.rb
|
@@ -81,12 +83,12 @@ files:
|
|
81
83
|
- lib/sass/value/number.rb
|
82
84
|
- lib/sass/value/number/unit.rb
|
83
85
|
- lib/sass/value/string.rb
|
84
|
-
homepage: https://github.com/
|
86
|
+
homepage: https://github.com/sass-contrib/sass-embedded-host-ruby
|
85
87
|
licenses:
|
86
88
|
- MIT
|
87
89
|
metadata:
|
88
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.69.
|
89
|
-
source_code_uri: https://github.com/
|
90
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.69.6
|
91
|
+
source_code_uri: https://github.com/sass-contrib/sass-embedded-host-ruby/tree/v1.69.6
|
90
92
|
funding_uri: https://github.com/sponsors/ntkme
|
91
93
|
post_install_message:
|
92
94
|
rdoc_options: []
|
@@ -96,14 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
98
|
requirements:
|
97
99
|
- - ">="
|
98
100
|
- !ruby/object:Gem::Version
|
99
|
-
version: 3.
|
101
|
+
version: 3.1.3
|
100
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
103
|
requirements:
|
102
104
|
- - ">="
|
103
105
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
106
|
+
version: '0'
|
105
107
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
108
|
+
rubygems_version: 3.5.3
|
107
109
|
signing_key:
|
108
110
|
specification_version: 4
|
109
111
|
summary: Use dart-sass with Ruby!
|