sassc-embedded 1.77.0 → 1.77.2

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: d513301805669f2944f1dcc4f6ee8775554122531c7d41abca281c05acbb8351
4
- data.tar.gz: 4a1576efa981b9c3e9b56a201793675d4764bb66b03cae8ea3f369eba9ed9f3f
3
+ metadata.gz: 5f6d451aad32416a320f1c23c4f312633e058955744c0da5a5e19ac967c2677d
4
+ data.tar.gz: 4d21e4f1aa6a0d79d697237e1825a4b770d4b85472c7dc2e762dcbcf3c842b51
5
5
  SHA512:
6
- metadata.gz: 10bf726fb6e87dabcdb0003c8dd104675233fc56800bac7b27b13ce936e568bf0c24ec7638325aa30bba01320b5e8b2f0bb95d93a69126fdd60df515382edf65
7
- data.tar.gz: 4998fcb9dd6b735b93802d32ea5067834e75dedcfd2ba6ee32debc3ec24bbe8dc6f6cb0347a265596f2ae0b3f00b78e436282f264f144bd9ee7e401f1fed3395
6
+ metadata.gz: 2dfd35f4e9053a3a51c89197c0079a877b20d8ee9f76cde280f20a40382452220e4afe735777c4fa99b7fd65e1d50c2aeef2aa05bba05734ff771c3c13b9c898
7
+ data.tar.gz: 8cde54ce2caca35192fcfd38c1f6244823c299924150418779e21e18635b7f3c70b1baef7a3cb8528d62ac598cfebd6388a51579a099aee1998351119e4c7ccd
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '1.77.0'
5
+ VERSION = '1.77.2'
6
6
  end
7
7
  end
@@ -46,11 +46,10 @@ module SassC
46
46
  css = result.css
47
47
  css += "\n" unless css.empty?
48
48
  unless @source_map.nil? || omit_source_map_url?
49
- url = URI.parse(output_url || file_url)
50
49
  source_mapping_url = if source_map_embed?
51
50
  "data:application/json;base64,#{[@source_map].pack('m0')}"
52
51
  else
53
- URI.file_urls_to_relative_url(source_map_file_url, url)
52
+ Uri.file_urls_to_relative_url(source_map_file_url, file_url)
54
53
  end
55
54
  css += "\n/*# sourceMappingURL=#{source_mapping_url} */"
56
55
  end
@@ -61,7 +60,7 @@ module SassC
61
60
  line = e.span&.start&.line
62
61
  line += 1 unless line.nil?
63
62
  url = e.span&.url
64
- path = (URI.file_urls_to_relative_path(url, URI.path_to_file_url("#{Dir.pwd}/")) if url&.start_with?('file:'))
63
+ path = (Uri.file_urls_to_relative_path(url, Uri.path_to_file_url("#{Dir.pwd}/")) if url&.start_with?('file:'))
65
64
  raise SyntaxError.new(e.full_message, filename: path, line:)
66
65
  end
67
66
 
@@ -69,19 +68,18 @@ module SassC
69
68
  raise NotRenderedError unless @loaded_urls
70
69
 
71
70
  Dependency.from_filenames(@loaded_urls.filter_map do |url|
72
- URI.file_url_to_path(url) if url.start_with?('file:') && !url.include?('?') && url != file_url
71
+ Uri.file_url_to_path(url) if url.start_with?('file:') && !url.include?('?') && url != file_url
73
72
  end)
74
73
  end
75
74
 
76
75
  def source_map
77
76
  raise NotRenderedError unless @source_map
78
77
 
79
- url = URI.parse(source_map_file_url || file_url)
78
+ url = Uri.parse(source_map_file_url || file_url)
80
79
  data = JSON.parse(@source_map)
81
- data['file'] = URI.file_urls_to_relative_url(output_url, url) if output_url
82
80
  data['sources'].map! do |source|
83
81
  if source.start_with?('file:')
84
- URI.file_urls_to_relative_url(source, url)
82
+ Uri.file_urls_to_relative_url(source, url)
85
83
  else
86
84
  source
87
85
  end
@@ -93,27 +91,13 @@ module SassC
93
91
  private
94
92
 
95
93
  def file_url
96
- @file_url ||= URI.path_to_file_url(File.absolute_path(filename || 'stdin'))
97
- end
98
-
99
- def output_path
100
- @output_path ||= @options.fetch(:output_path) do
101
- "#{filename.delete_suffix(File.extname(filename))}.css" if filename
102
- end
103
- end
104
-
105
- def output_url
106
- @output_url ||= (URI.path_to_file_url(File.absolute_path(output_path)) if output_path)
94
+ @file_url ||= Uri.path_to_file_url(File.absolute_path(filename || 'stdin'))
107
95
  end
108
96
 
109
97
  def source_map_file_url
110
98
  @source_map_file_url ||= if source_map_file
111
- # https://github.com/sass-contrib/sassc-embedded-shim-ruby/pull/69
112
- # SassC does not encode path as uri for sourceMappingURL, which is technically wrong.
113
- # However, this behavior has been abused to append query string to sourceMappingURL.
114
- components = source_map_file.split('?', 2)
115
- components[0] = URI.path_to_file_url(File.absolute_path(components[0]))
116
- components.join('?')
99
+ Uri.path_to_file_url(File.absolute_path(source_map_file))
100
+ .gsub('%3F', '?') # https://github.com/sass-contrib/sassc-embedded-shim-ruby/pull/69
117
101
  end
118
102
  end
119
103
 
@@ -317,12 +301,12 @@ module SassC
317
301
 
318
302
  containing_url = context.containing_url
319
303
 
320
- path = URI.decode_uri_component(url)
321
- parent_path = URI.file_url_to_path(containing_url)
304
+ path = Uri.decode_uri_component(url)
305
+ parent_path = Uri.file_url_to_path(containing_url)
322
306
  parent_dir = File.dirname(parent_path)
323
307
 
324
308
  if containing_url.include?('?')
325
- canonical_url = URI.path_to_file_url(File.absolute_path(path, parent_dir))
309
+ canonical_url = Uri.path_to_file_url(File.absolute_path(path, parent_dir))
326
310
  if @importer_results.key?(canonical_url)
327
311
  canonical_url
328
312
  else
@@ -359,7 +343,7 @@ module SassC
359
343
 
360
344
  def resolve_file_url(path, parent_dir, from_import)
361
345
  resolved = FileSystemImporter.resolve_path(File.absolute_path(path, parent_dir), from_import)
362
- URI.path_to_file_url(resolved) unless resolved.nil?
346
+ Uri.path_to_file_url(resolved) unless resolved.nil?
363
347
  end
364
348
 
365
349
  def syntax(path)
@@ -375,7 +359,7 @@ module SassC
375
359
 
376
360
  def import_to_native(import, parent_dir, from_import, canonicalize)
377
361
  if import.source
378
- canonical_url = URI.path_to_file_url(File.absolute_path(import.path, parent_dir))
362
+ canonical_url = Uri.path_to_file_url(File.absolute_path(import.path, parent_dir))
379
363
  @importer_results[canonical_url] = if import.source.is_a?(Hash)
380
364
  {
381
365
  contents: import.source[:contents],
@@ -394,13 +378,13 @@ module SassC
394
378
  return resolve_file_url(import.path, parent_dir, from_import)
395
379
  end
396
380
 
397
- URI.encode_uri_path_component(import.path)
381
+ Uri.encode_uri_path_component(import.path)
398
382
  end
399
383
 
400
384
  def imports_to_native(imports, parent_dir, from_import, url, containing_url)
401
385
  return import_to_native(imports.first, parent_dir, from_import, true) if imports.one?
402
386
 
403
- canonical_url = "#{containing_url}?url=#{URI.encode_uri_query_component(url)}&from_import=#{from_import}"
387
+ canonical_url = "#{containing_url}?url=#{Uri.encode_uri_query_component(url)}&from_import=#{from_import}"
404
388
  @importer_results[canonical_url] = {
405
389
  contents: imports.flat_map do |import|
406
390
  at_rule = from_import ? '@import' : '@forward'
@@ -564,15 +548,11 @@ module SassC
564
548
  end
565
549
  end
566
550
 
567
- module URI
551
+ module Uri
568
552
  module_function
569
553
 
570
- def join(...)
571
- ::URI.join(...).to_s
572
- end
573
-
574
- def parse(str)
575
- ::URI.parse(str)
554
+ def parse(...)
555
+ ::URI.parse(...)
576
556
  end
577
557
 
578
558
  def encode_uri_path_component(str)
@@ -623,5 +603,5 @@ module SassC
623
603
  end
624
604
  end
625
605
 
626
- private_constant :URI
606
+ private_constant :Uri
627
607
  end
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.77.0
4
+ version: 1.77.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-29 00:00:00.000000000 Z
11
+ date: 2024-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-embedded
@@ -79,7 +79,7 @@ licenses:
79
79
  metadata:
80
80
  bug_tracker_uri: https://github.com/sass-contrib/sassc-embedded-shim-ruby/issues
81
81
  documentation_uri: https://rubydoc.info/gems/sassc
82
- source_code_uri: https://github.com/sass-contrib/sassc-embedded-shim-ruby/tree/v1.77.0
82
+ source_code_uri: https://github.com/sass-contrib/sassc-embedded-shim-ruby/tree/v1.77.2
83
83
  funding_uri: https://github.com/sponsors/ntkme
84
84
  rubygems_mfa_required: 'true'
85
85
  post_install_message: