sassc-embedded 1.3.1 → 1.4.0
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/lib/sassc/embedded/version.rb +1 -1
- data/lib/sassc/embedded.rb +26 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c93f068bcc4406780bad76da750f2b265943a971456d3b56a14b0bdb2f0be8a
|
4
|
+
data.tar.gz: c851519ef1b2f08fe4370f4669b9df263b7264844911df873de30273748b4675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14f22ec99ba45f9fddf083a1bccab5b34b3c48e745cfd30c53078c504d90d3e870c27effc1c9ae20b32ead54602dffadfa48b59993a61fa82991c9cafa1cd856
|
7
|
+
data.tar.gz: 6a1d3fde2932a3c83932bb6601ad7e5ac0d945d69f69d0d5acf36c378401afdd3cbc7cb00dcb835b10be697fdbdb378bbcffd1e957e2995e686f3d10f546c6b7
|
data/lib/sassc/embedded.rb
CHANGED
@@ -286,8 +286,7 @@ module SassC
|
|
286
286
|
def initialize(importer)
|
287
287
|
@importer = importer
|
288
288
|
@importer_results = {}
|
289
|
-
@
|
290
|
-
@parent_urls = [URL.parse(URL.path_to_file_url(File.absolute_path(@importer.options[:filename] || 'stdin')))]
|
289
|
+
@parent_urls = [URL.path_to_file_url(File.absolute_path(@importer.options[:filename] || 'stdin'))]
|
291
290
|
end
|
292
291
|
|
293
292
|
def canonicalize(url, from_import:)
|
@@ -305,7 +304,7 @@ module SassC
|
|
305
304
|
return unless url.start_with?(Protocol::FILE)
|
306
305
|
|
307
306
|
path = URL.parse(url).route_from(@parent_urls.last).to_s
|
308
|
-
parent_path = URL.file_url_to_path(@parent_urls.last
|
307
|
+
parent_path = URL.file_url_to_path(@parent_urls.last)
|
309
308
|
|
310
309
|
imports = @importer.imports(path, parent_path)
|
311
310
|
imports = [SassC::Importer::Import.new(path)] if imports.nil?
|
@@ -324,7 +323,7 @@ module SassC
|
|
324
323
|
if canonical_url.start_with?(Protocol::IMPORT)
|
325
324
|
@importer_results.delete(canonical_url)
|
326
325
|
elsif canonical_url.start_with?(Protocol::FILE)
|
327
|
-
@parent_urls.push(
|
326
|
+
@parent_urls.push(canonical_url)
|
328
327
|
if @importer_results.key?(canonical_url)
|
329
328
|
@importer_results.delete(canonical_url)
|
330
329
|
else
|
@@ -339,7 +338,7 @@ module SassC
|
|
339
338
|
@parent_urls.pop
|
340
339
|
{
|
341
340
|
contents: '',
|
342
|
-
syntax:
|
341
|
+
syntax: :scss
|
343
342
|
}
|
344
343
|
end
|
345
344
|
end
|
@@ -374,11 +373,19 @@ module SassC
|
|
374
373
|
contents: imports.flat_map do |import|
|
375
374
|
file_url = URL.path_to_file_url(import.path)
|
376
375
|
if import.source
|
377
|
-
@importer_results[file_url] =
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
376
|
+
@importer_results[file_url] = if import.source.is_a?(Hash)
|
377
|
+
{
|
378
|
+
contents: import.source[:contents],
|
379
|
+
syntax: import.source[:syntax],
|
380
|
+
source_map_url: file_url
|
381
|
+
}
|
382
|
+
else
|
383
|
+
{
|
384
|
+
contents: import.source,
|
385
|
+
syntax: syntax(import.path),
|
386
|
+
source_map_url: file_url
|
387
|
+
}
|
388
|
+
end
|
382
389
|
end
|
383
390
|
[
|
384
391
|
"@import #{"#{Protocol::LOAD}#{file_url}".inspect};",
|
@@ -393,6 +400,15 @@ module SassC
|
|
393
400
|
private_constant :Importer
|
394
401
|
end
|
395
402
|
|
403
|
+
class Sass2Scss
|
404
|
+
def self.convert(sass)
|
405
|
+
{
|
406
|
+
contents: sass,
|
407
|
+
syntax: :indented
|
408
|
+
}
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
396
412
|
module Script
|
397
413
|
module ValueConversion
|
398
414
|
def self.from_native(value, options)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sassc-embedded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
@@ -138,8 +138,8 @@ homepage: https://github.com/ntkme/sassc-embedded-polyfill-ruby
|
|
138
138
|
licenses:
|
139
139
|
- MIT
|
140
140
|
metadata:
|
141
|
-
documentation_uri: https://rubydoc.info/gems/sassc-embedded/1.
|
142
|
-
source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v1.
|
141
|
+
documentation_uri: https://rubydoc.info/gems/sassc-embedded/1.4.0
|
142
|
+
source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v1.4.0
|
143
143
|
funding_uri: https://github.com/sponsors/ntkme
|
144
144
|
post_install_message:
|
145
145
|
rdoc_options: []
|