sassc-embedded 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ff232a1e9ffcdb66044bbf2bf16cb7f30e103391a59c8d77198a2c273fb23ee
4
- data.tar.gz: b9f778ee93529d8ea8fd78e117938dbefd85effbade12914b4766f6b462516cb
3
+ metadata.gz: 2c93f068bcc4406780bad76da750f2b265943a971456d3b56a14b0bdb2f0be8a
4
+ data.tar.gz: c851519ef1b2f08fe4370f4669b9df263b7264844911df873de30273748b4675
5
5
  SHA512:
6
- metadata.gz: afe628bdf03866ce81814e6063075c7fde3b5dcd577a5f2f914feb65d71f343992f34d96b943669c10cb0ccc5c6655f9816092a347c5173d3a83abd4e2ddb3eb
7
- data.tar.gz: df0aac452aca91d9df03785bfd61c09ac75b6fcc0506316bc5ddf800634cde576e1f0b526735a7d5ed5f61506d81db9e01b41f23dd5a938070b546f17131a16c
6
+ metadata.gz: 14f22ec99ba45f9fddf083a1bccab5b34b3c48e745cfd30c53078c504d90d3e870c27effc1c9ae20b32ead54602dffadfa48b59993a61fa82991c9cafa1cd856
7
+ data.tar.gz: 6a1d3fde2932a3c83932bb6601ad7e5ac0d945d69f69d0d5acf36c378401afdd3cbc7cb00dcb835b10be697fdbdb378bbcffd1e957e2995e686f3d10f546c6b7
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '1.3.1'
5
+ VERSION = '1.4.0'
6
6
  end
7
7
  end
@@ -286,8 +286,7 @@ module SassC
286
286
  def initialize(importer)
287
287
  @importer = importer
288
288
  @importer_results = {}
289
- @base_url = URL.parse(URL.path_to_file_url("#{File.absolute_path('')}/"))
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.to_s)
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(URL.parse(canonical_url))
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: 'scss'
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
- contents: import.source,
379
- syntax: syntax(import.path),
380
- source_map_url: file_url
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.3.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.3.1
142
- source_code_uri: https://github.com/ntkme/sassc-embedded-polyfill-ruby/tree/v1.3.1
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: []