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 +4 -4
- data/lib/sass/embedded/legacy.rb +19 -15
- data/lib/sass/embedded/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12ce63a7fedb676fb7898007947caf7cf9c0b3f9cbf9ace7650a96ea975c759e
|
4
|
+
data.tar.gz: ae244e0545f7de1c2c96adc9aff32839d3d9a91e4622b595240bc6788acd7279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3fee2d250ed1b1f0a4aa4dd5bf3ea86435b1113ca9776094121f6509f3da2b7f10f0bbdb75b312b7a1a71be71f57f03fcb6c3e9614f62cda4d50df8315a2cc5
|
7
|
+
data.tar.gz: 67cf5ff660de4c7bac4a9787dd0c896d491eae3bceed1ab93023dead14a3489b19827e5270d453c950d09c990216c42cb645c4ca59ffb5a0f66679357acc609d
|
data/lib/sass/embedded/legacy.rb
CHANGED
@@ -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 :
|
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
|
-
|
383
|
+
Url.uri_parser.escape "#{FILE_SCHEME}#{Gem.win_platform? ? '/' : ''}#{path}"
|
386
384
|
else
|
387
|
-
|
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
|
-
|
391
|
+
Url.uri_parser.unescape url[(FILE_SCHEME.length + (Gem.win_platform? ? 1 : 0))..]
|
394
392
|
else
|
395
|
-
|
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
|
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.
|
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.
|
167
|
-
source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.
|
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: []
|