sass-embedded 1.4.1 → 1.4.4
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/ext/sass/package.json +1 -1
- data/lib/sass/embedded/host/importer_registry.rb +1 -1
- data/lib/sass/embedded/host.rb +2 -13
- data/lib/sass/embedded/protofier.rb +2 -2
- data/lib/sass/embedded/version.rb +1 -1
- data/lib/sass/value/color.rb +1 -1
- data/lib/sass/value/number.rb +11 -11
- metadata +8 -9
- data/lib/sass/embedded/host/no_op_importer.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49bd3b911e41e257e71290711d0f1e1e879356ecd6ae034d27db10b6660951c7
|
4
|
+
data.tar.gz: b18f1e14cbfe775dbf2cec9dc80084b56652cb250760283987f7dc7f2b535b40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b95b557f7512f814cc08bda99f11ae0501db25cbc7b59c351f7172d2caf37c2d49d750af4bf24b1cad6c7ed3da7bf009f08b6f726fb2d0eb78383669f2b834e1
|
7
|
+
data.tar.gz: ac3399afd9e07b372e9a0f87528e9dedec380a33a2ae7aed25efe7ad305f54b30dd97cb7be6f3edfe65bd0239eea3a2a06de48681f15a8a8cbaf924aa95aa150
|
data/ext/sass/package.json
CHANGED
@@ -71,7 +71,7 @@ module Sass
|
|
71
71
|
success: EmbeddedProtocol::InboundMessage::ImportResponse::ImportSuccess.new(
|
72
72
|
contents: importer_result.contents,
|
73
73
|
syntax: Protofier.to_proto_syntax(importer_result.syntax),
|
74
|
-
source_map_url: importer_result.respond_to?(:source_map_url)
|
74
|
+
source_map_url: (importer_result.source_map_url&.to_s if importer_result.respond_to?(:source_map_url))
|
75
75
|
)
|
76
76
|
)
|
77
77
|
rescue StandardError => e
|
data/lib/sass/embedded/host.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require_relative 'host/function_registry'
|
4
4
|
require_relative 'host/importer_registry'
|
5
5
|
require_relative 'host/logger_registry'
|
6
|
-
require_relative 'host/no_op_importer'
|
7
6
|
require_relative 'host/value_protofier'
|
8
7
|
|
9
8
|
module Sass
|
@@ -55,18 +54,10 @@ module Sass
|
|
55
54
|
source: source,
|
56
55
|
url: url&.to_s,
|
57
56
|
syntax: Protofier.to_proto_syntax(syntax),
|
58
|
-
importer:
|
59
|
-
@importer_registry.register(importer)
|
60
|
-
elsif url
|
61
|
-
EmbeddedProtocol::InboundMessage::CompileRequest::Importer.new(
|
62
|
-
path: File.absolute_path('.')
|
63
|
-
)
|
64
|
-
else
|
65
|
-
@importer_registry.register(NoOpImporter)
|
66
|
-
end
|
57
|
+
importer: (@importer_registry.register(importer) unless importer.nil?)
|
67
58
|
)
|
68
59
|
end,
|
69
|
-
path:
|
60
|
+
path: (File.absolute_path(path) unless path.nil?),
|
70
61
|
style: Protofier.to_proto_output_style(style),
|
71
62
|
source_map: source_map,
|
72
63
|
source_map_include_sources: source_map_include_sources,
|
@@ -134,8 +125,6 @@ module Sass
|
|
134
125
|
private
|
135
126
|
|
136
127
|
def await
|
137
|
-
raise EOFError if defined? @async
|
138
|
-
|
139
128
|
@connection = @channel.connect(self)
|
140
129
|
@async = Async.new
|
141
130
|
yield
|
@@ -31,7 +31,7 @@ module Sass
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def from_proto_source_span(source_span)
|
34
|
-
return
|
34
|
+
return if source_span.nil?
|
35
35
|
|
36
36
|
Logger::SourceSpan.new(from_proto_source_location(source_span.start),
|
37
37
|
from_proto_source_location(source_span.end),
|
@@ -41,7 +41,7 @@ module Sass
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def from_proto_source_location(source_location)
|
44
|
-
return
|
44
|
+
return if source_location.nil?
|
45
45
|
|
46
46
|
Logger::SourceLocation.new(source_location.offset,
|
47
47
|
source_location.line,
|
data/lib/sass/value/color.rb
CHANGED
data/lib/sass/value/number.rb
CHANGED
@@ -94,17 +94,7 @@ module Sass
|
|
94
94
|
|
95
95
|
# @return [Integer]
|
96
96
|
def hash
|
97
|
-
@hash ||=
|
98
|
-
FuzzyMath.hash(value)
|
99
|
-
elsif single_unit?
|
100
|
-
FuzzyMath.hash(
|
101
|
-
value * Unit.canonical_multiplier_for_unit(numerator_units.first)
|
102
|
-
)
|
103
|
-
else
|
104
|
-
FuzzyMath.hash(
|
105
|
-
value * Unit.canonical_multiplier(numerator_units) / Unit.canonical_multiplier(denominator_units)
|
106
|
-
)
|
107
|
-
end
|
97
|
+
@hash ||= FuzzyMath.hash(canonical_units_value)
|
108
98
|
end
|
109
99
|
|
110
100
|
# @return [::Boolean]
|
@@ -265,6 +255,16 @@ module Sass
|
|
265
255
|
numerator_units.length == 1 && denominator_units.empty?
|
266
256
|
end
|
267
257
|
|
258
|
+
def canonical_units_value
|
259
|
+
if unitless?
|
260
|
+
value
|
261
|
+
elsif single_unit?
|
262
|
+
value * Unit.canonical_multiplier_for_unit(numerator_units.first)
|
263
|
+
else
|
264
|
+
value * Unit.canonical_multiplier(numerator_units) / Unit.canonical_multiplier(denominator_units)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
268
|
def coerce_or_convert_value(new_numerator_units, new_denominator_units,
|
269
269
|
coerce_unitless:,
|
270
270
|
name: nil,
|
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.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.28.1
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.28.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop-performance
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.10.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.10.0
|
111
111
|
description: A Ruby library that will communicate with Embedded Dart Sass using the
|
112
112
|
Embedded Sass protocol.
|
113
113
|
email:
|
@@ -134,7 +134,6 @@ files:
|
|
134
134
|
- lib/sass/embedded/host/function_registry.rb
|
135
135
|
- lib/sass/embedded/host/importer_registry.rb
|
136
136
|
- lib/sass/embedded/host/logger_registry.rb
|
137
|
-
- lib/sass/embedded/host/no_op_importer.rb
|
138
137
|
- lib/sass/embedded/host/value_protofier.rb
|
139
138
|
- lib/sass/embedded/protofier.rb
|
140
139
|
- lib/sass/embedded/structifier.rb
|
@@ -160,8 +159,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
|
|
160
159
|
licenses:
|
161
160
|
- MIT
|
162
161
|
metadata:
|
163
|
-
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.4.
|
164
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.4.
|
162
|
+
documentation_uri: https://rubydoc.info/gems/sass-embedded/1.4.4
|
163
|
+
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v1.4.4
|
165
164
|
funding_uri: https://github.com/sponsors/ntkme
|
166
165
|
post_install_message:
|
167
166
|
rdoc_options: []
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Sass
|
4
|
-
class Embedded
|
5
|
-
class Host
|
6
|
-
# An importer that never imports any stylesheets.
|
7
|
-
module NoOpImporter
|
8
|
-
module_function
|
9
|
-
|
10
|
-
def canonicalize(*); end
|
11
|
-
def load(*); end
|
12
|
-
end
|
13
|
-
|
14
|
-
private_constant :NoOpImporter
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|