sass-embedded 0.19.1 → 0.19.4

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: 98e2d595f559611d4bf150ab826be0386123267999a77b52b37b29b780dacadc
4
- data.tar.gz: 409876982853e88acef3ea3a0d9dde84c6d4ad12e63fccfa24236fb6de0d1911
3
+ metadata.gz: 12ce63a7fedb676fb7898007947caf7cf9c0b3f9cbf9ace7650a96ea975c759e
4
+ data.tar.gz: ae244e0545f7de1c2c96adc9aff32839d3d9a91e4622b595240bc6788acd7279
5
5
  SHA512:
6
- metadata.gz: 4275d81a3be35d78b111c8d34b04046e4390c5def447dd1d91cf9ea042ae9d31c87a7c05842666f83609565f69146fb8c5a6f617501d5e604251e70fbbf0121f
7
- data.tar.gz: 0bcd2e6d4d45fe029ff751fcc0f884c7b31fb829cd9ed17a0e2b6ae5d7916f7013e6f4a5e61c4e5e2d06972a58e4514cb70b7eb5fa6ce129a398dd1ce125611c
6
+ metadata.gz: d3fee2d250ed1b1f0a4aa4dd5bf3ea86435b1113ca9776094121f6509f3da2b7f10f0bbdb75b312b7a1a71be71f57f03fcb6c3e9614f62cda4d50df8315a2cc5
7
+ data.tar.gz: 67cf5ff660de4c7bac4a9787dd0c896d491eae3bceed1ab93023dead14a3489b19827e5270d453c950d09c990216c42cb645c4ca59ffb5a0f66679357acc609d
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'base64'
4
- require 'json'
5
- require 'pathname'
6
- require 'uri'
7
-
8
3
  # The Sass module.
9
4
  #
10
5
  # This communicates with Embedded Dart Sass using the Embedded Sass protocol.
@@ -87,10 +82,10 @@ module Sass
87
82
  source_map_root: '',
88
83
  functions: {},
89
84
  importer: [])
90
- start = now
91
-
92
85
  raise ArgumentError, 'either data or file must be set' if file.nil? && data.nil?
93
86
 
87
+ start = now
88
+
94
89
  indent_type = parse_indent_type(indent_type)
95
90
  indent_width = parse_indent_width(indent_width)
96
91
  linefeed = parse_linefeed(linefeed)
@@ -217,6 +212,8 @@ module Sass
217
212
  source_map_root:)
218
213
  return if map.nil? || map.empty?
219
214
 
215
+ require 'json'
216
+
220
217
  map_data = JSON.parse(map)
221
218
 
222
219
  map_data['sourceRoot'] = source_map_root
@@ -271,6 +268,8 @@ module Sass
271
268
 
272
269
  unless map.nil? || omit_source_map_url == true
273
270
  url = if source_map_embed
271
+ require 'base64'
272
+
274
273
  "data:application/json;base64,#{Base64.strict_encode64(map)}"
275
274
  elsif out_file
276
275
  relative_path(File.dirname(out_file), source_map)
@@ -326,6 +325,8 @@ module Sass
326
325
 
327
326
  # @deprecated
328
327
  def relative_path(from, to)
328
+ require 'pathname'
329
+
329
330
  Pathname.new(File.absolute_path(to)).relative_path_from(Pathname.new(File.absolute_path(from))).to_s
330
331
  end
331
332
 
@@ -371,30 +372,33 @@ module Sass
371
372
  # @deprecated
372
373
  # The {Url} module.
373
374
  module Url
374
- # The {::URI::Parser} that is in consistent with RFC 2396 (URI Generic Syntax) and dart:core library.
375
- URI_PARSER = URI::Parser.new({ RESERVED: ';/?:@&=+$,' })
376
-
377
375
  FILE_SCHEME = 'file://'
378
376
 
379
- private_constant :URI_PARSER, :FILE_SCHEME
377
+ private_constant :FILE_SCHEME
380
378
 
381
379
  module_function
382
380
 
383
381
  def path_to_file_url(path)
384
382
  if File.absolute_path? path
385
- URI_PARSER.escape "#{FILE_SCHEME}#{Gem.win_platform? ? '/' : ''}#{path}"
383
+ Url.uri_parser.escape "#{FILE_SCHEME}#{Gem.win_platform? ? '/' : ''}#{path}"
386
384
  else
387
- URI_PARSER.escape path
385
+ Url.uri_parser.escape path
388
386
  end
389
387
  end
390
388
 
391
389
  def file_url_to_path(url)
392
390
  if url.start_with? FILE_SCHEME
393
- URI_PARSER.unescape url[(FILE_SCHEME.length + (Gem.win_platform? ? 1 : 0))..]
391
+ Url.uri_parser.unescape url[(FILE_SCHEME.length + (Gem.win_platform? ? 1 : 0))..]
394
392
  else
395
- URI_PARSER.unescape url
393
+ Url.uri_parser.unescape url
396
394
  end
397
395
  end
396
+
397
+ def uri_parser
398
+ require 'uri'
399
+
400
+ @uri_parser ||= URI::Parser.new({ RESERVED: ';/?:@&=+$,' })
401
+ end
398
402
  end
399
403
 
400
404
  private_constant :LegacyImporter
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '0.19.1'
5
+ VERSION = '0.19.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass-embedded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.19.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - なつき
@@ -163,8 +163,8 @@ homepage: https://github.com/ntkme/sass-embedded-host-ruby
163
163
  licenses:
164
164
  - MIT
165
165
  metadata:
166
- documentation_uri: https://www.rubydoc.info/gems/sass-embedded/0.19.1
167
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.1
166
+ documentation_uri: https://www.rubydoc.info/gems/sass-embedded/0.19.4
167
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.4
168
168
  funding_uri: https://github.com/sponsors/ntkme
169
169
  post_install_message:
170
170
  rdoc_options: []