sassc-embedded 1.68.1 → 1.68.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: 0c1bae171b142e9c93398da7fd657e968c0804ce760bd7c05e04dc59a1d6c408
4
- data.tar.gz: e45f9276e88a116aa2f83f592187b3705a6b2989b7837e90ca6917fbc418a51e
3
+ metadata.gz: e9bc5cac9cd760e5a3763752ed7972d9071daac5c73a4470ef51674222dea3d4
4
+ data.tar.gz: 5ee33293cc9ea0911f557812d5e6fd8d9f13c9da96427f0cb1e60f1ac806fe9b
5
5
  SHA512:
6
- metadata.gz: 5f36c1fd78fbebbb9af4bf20126b0024aa0ca15a1900ed258390c449d1de36294c96160c0e9c76777d1a2ff053564b650b0b048038ceb03f7a2c64f3c9f8d88f
7
- data.tar.gz: fc2bf82ab1c39773ea130bea388028c649dab02e71e35c9f31a2cbbb4f9a30be4718a535b628f5dbeef5fac1b43009e6c3776765c3d10b2399d0aba8019bd9ab
6
+ metadata.gz: 17245ae4b95349b96a89991ba2b9a6486a71e37dc146230f433416c224cd51f243983907415beb3464f5ef301c343406b197a3e85396dbc327e9de34d9d193fd
7
+ data.tar.gz: b2d86f258395f846fe809da335efc70e3be4e9527dd4e85c9744da0f4dc858e0860e6020f4a0fd6f72ce04b391c84f7d524061a2aad362492530f6c12766105e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Embedded
5
- VERSION = '1.68.1'
5
+ VERSION = '1.68.2'
6
6
  end
7
7
  end
@@ -49,7 +49,7 @@ module SassC
49
49
  source_mapping_url = if source_map_embed?
50
50
  "data:application/json;base64,#{[@source_map].pack('m0')}"
51
51
  else
52
- URL.unescape(URL.parse(source_map_file_url).route_from(url).to_s)
52
+ URL.file_urls_to_relative_url(source_map_file_url, url)
53
53
  end
54
54
  css += "\n/*# sourceMappingURL=#{source_mapping_url} */"
55
55
  end
@@ -61,7 +61,7 @@ module SassC
61
61
  line += 1 unless line.nil?
62
62
  url = e.span&.url
63
63
  path = if url&.start_with?(Protocol::FILE)
64
- URL.unescape(URL.parse(url).route_from(URL.path_to_file_url("#{Dir.pwd}/")).to_s)
64
+ URL.file_urls_to_relative_path(url, URL.path_to_file_url("#{Dir.pwd}/"))
65
65
  end
66
66
  raise SyntaxError.new(e.full_message, filename: path, line: line)
67
67
  end
@@ -79,10 +79,10 @@ module SassC
79
79
 
80
80
  url = URL.parse(source_map_file_url || file_url)
81
81
  data = JSON.parse(@source_map)
82
- data['file'] = URL.unescape(URL.parse(output_url).route_from(url).to_s) if output_url
82
+ data['file'] = URL.file_urls_to_relative_url(output_url, url) if output_url
83
83
  data['sources'].map! do |source|
84
84
  if source.start_with?(Protocol::FILE)
85
- URL.unescape(URL.parse(source).route_from(url).to_s)
85
+ URL.file_urls_to_relative_url(source, url)
86
86
  else
87
87
  source
88
88
  end
@@ -309,7 +309,7 @@ module SassC
309
309
  @parent_urls.push(canonical_url)
310
310
  canonical_url
311
311
  elsif url.start_with?(Protocol::FILE)
312
- path = URL.unescape(URL.parse(url).route_from(@parent_urls.last).to_s)
312
+ path = URL.file_urls_to_relative_path(url, @parent_urls.last)
313
313
  parent_path = URL.file_url_to_path(@parent_urls.last)
314
314
 
315
315
  imports = @importer.imports(path, parent_path)
@@ -354,7 +354,7 @@ module SassC
354
354
  end
355
355
 
356
356
  def resolve_file_url(url, parent_url, from_import)
357
- path = URL.unescape(URL.parse(url).route_from(parent_url).to_s)
357
+ path = URL.file_urls_to_relative_path(url, parent_url)
358
358
  parent_path = URL.file_url_to_path(parent_url)
359
359
  [File.dirname(parent_path)].concat(load_paths).each do |load_path|
360
360
  resolved = FileImporter.resolve_path(File.absolute_path(path, load_path), from_import)
@@ -568,6 +568,14 @@ module SassC
568
568
  PARSER.unescape(str)
569
569
  end
570
570
 
571
+ def file_urls_to_relative_url(url, from_url)
572
+ URL.parse(url).route_from(from_url).to_s
573
+ end
574
+
575
+ def file_urls_to_relative_path(url, from_url)
576
+ URL.unescape(file_urls_to_relative_url(url, from_url))
577
+ end
578
+
571
579
  def file_url_to_path(url)
572
580
  return if url.nil?
573
581
 
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.68.1
4
+ version: 1.68.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -78,7 +78,7 @@ licenses:
78
78
  - MIT
79
79
  metadata:
80
80
  documentation_uri: https://rubydoc.info/gems/sassc
81
- source_code_uri: https://github.com/ntkme/sassc-embedded-shim-ruby/tree/v1.68.1
81
+ source_code_uri: https://github.com/ntkme/sassc-embedded-shim-ruby/tree/v1.68.2
82
82
  funding_uri: https://github.com/sponsors/ntkme
83
83
  post_install_message:
84
84
  rdoc_options: []