sassc-embedded 1.5.4 → 1.5.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e5e1e76c99f6d9c1e0735114d4c1fee858fbf466878fa45fb607142d605886b
4
- data.tar.gz: 2c428bbc53b229b9ecbd6ac26a3f559a2eb47b458d02855e64b444d6238dc0e9
3
+ metadata.gz: 695381cf5ae96903ffaf015c6e406eab12c38312008ee5dce88e2f1658d6da35
4
+ data.tar.gz: c5c981214af6123d9c17ff3dc4b6099bc78864419df9c29848ce146ebbfeca2d
5
5
  SHA512:
6
- metadata.gz: 55b738463c259f446fb89f4373a5b6929f3c9abf07cd403217c860036780cb4a2737a6c2deceb3ef470baf9e523eb76794579a9fa75fe4b2d807439fa0c8ee9e
7
- data.tar.gz: 222ddb543a2aea77fa84cc625c6a920c5350598c263defcedddf8db638dd704a6061a7b7d15ac61ad0299e8ec02520af76a58242e6774a86c6d591f1c4dd13f5
6
+ metadata.gz: 9a346cd91ea29ae9618460eee15592b1316948637bae1054a343521f9a0194b290c972d37481fd91b068d47bf83d38a033efb2f9e20f3713fcbc7ad339110cbb
7
+ data.tar.gz: 36d53934e2f475d3c62a42a5f7530c32668d42d4ba3a09a84eed6177bb9256d4dc7383adf64d80b6863590bffbfc676c6cec6b792b24523cbce7b516d887ff5d
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '1.5.4'
5
+ VERSION = '1.5.5'
6
6
  end
7
7
  end
@@ -295,6 +295,8 @@ module SassC
295
295
  def initialize(importer)
296
296
  @importer = importer
297
297
  @importer_results = {}
298
+ @load_id = 0
299
+ @load_urls = {}
298
300
  @parent_urls = [URL.path_to_file_url(File.absolute_path(@importer.options[:filename] || 'stdin'))]
299
301
  end
300
302
 
@@ -302,7 +304,7 @@ module SassC
302
304
  return url if url.start_with?(Protocol::IMPORT, Protocol::LOADED)
303
305
 
304
306
  if url.start_with?(Protocol::LOAD)
305
- url = url.delete_prefix(Protocol::LOAD)
307
+ url = @load_urls.delete(url.delete_prefix(Protocol::LOAD))
306
308
  return url if @importer_results.key?(url)
307
309
 
308
310
  path = URL.parse(url).route_from(@parent_urls.last).to_s
@@ -382,25 +384,28 @@ module SassC
382
384
  def imports_to_native(imports)
383
385
  {
384
386
  contents: imports.flat_map do |import|
385
- file_url = URL.path_to_file_url(import.path)
387
+ load_id = @load_id
388
+ @load_id = load_id.next
389
+ load_url = URL.path_to_file_url(import.path)
390
+ @load_urls[load_id.to_s] = load_url
386
391
  if import.source
387
- @importer_results[file_url] = if import.source.is_a?(Hash)
392
+ @importer_results[load_url] = if import.source.is_a?(Hash)
388
393
  {
389
394
  contents: import.source[:contents],
390
395
  syntax: import.source[:syntax],
391
- source_map_url: file_url
396
+ source_map_url: load_url
392
397
  }
393
398
  else
394
399
  {
395
400
  contents: import.source,
396
401
  syntax: syntax(import.path),
397
- source_map_url: file_url
402
+ source_map_url: load_url
398
403
  }
399
404
  end
400
405
  end
401
406
  [
402
- "@import #{"#{Protocol::LOAD}#{file_url}".inspect};",
403
- "@import #{"#{Protocol::LOADED}#{file_url}".inspect};"
407
+ "@import \"#{Protocol::LOAD}#{load_id}\";",
408
+ "@import \"#{Protocol::LOADED}#{load_id}\";"
404
409
  ]
405
410
  end.join("\n"),
406
411
  syntax: :scss
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassc-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-05 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sassc
@@ -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.5.4
142
- source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v1.5.4
141
+ documentation_uri: https://rubydoc.info/gems/sassc-embedded/1.5.5
142
+ source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v1.5.5
143
143
  funding_uri: https://github.com/sponsors/ntkme
144
144
  post_install_message:
145
145
  rdoc_options: []