sass-embedded 0.19.2 → 0.19.5

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: 827e324d735fe63938d7ddeb8d13c31577d9eec28971561bf6eae4cca7013eeb
4
- data.tar.gz: b8536a68113173ca68edecca565ef7f4e13aba5a647902f0dd4d1411c2127380
3
+ metadata.gz: 1231cd99e6d3df128ffa348ac4e57f9dfef1d4d2bdd45cd916f24acf9c077f33
4
+ data.tar.gz: '0293ab277eb26fe189c6063cd3af3a6fe875fa521d7d5b80f6544ed88e0e12e7'
5
5
  SHA512:
6
- metadata.gz: 9c16c31eec049d62c380049e2b565fcb1d05c55205f3f5966b43b47fd058d1c0fffc959f178ed68b47465cbd0c152b355c8196912a3688ba01a2c5783a2b9719
7
- data.tar.gz: 4d4836379db8fa44061bf92c49c2a49dcb76f0299fad42df56c8c4d59ce0babf66d8245f3c73e36b51a6f58062050e9bff8bccbfb5356a8b87b40329abcb1f41
6
+ metadata.gz: fff3b1ffa24f23e062c11e962db486b2710740442dc2314158530bbc7481bb27bfb631f3242a35bcd91d4bf17846d9befa2b32e7416a6188480ec4c6c4f3b0c9
7
+ data.tar.gz: c6154169700856bdf1d96497b0e8f2906f2dc6eb28f6c0213c603d7b69fcd3693ef034ae897ae9df826544908a02f3f5ea06d0f7234912fb8d9a893e6c8caed6
@@ -8,7 +8,6 @@ module Sass
8
8
  class Host
9
9
  def initialize(channel)
10
10
  @channel = channel
11
- @mutex = Mutex.new
12
11
  end
13
12
 
14
13
  def id
@@ -119,14 +118,14 @@ module Sass
119
118
  private
120
119
 
121
120
  def await
122
- @mutex.synchronize do
123
- @connection = @channel.connect(self)
124
- @async = Async.new
125
- yield
126
- @async.await
127
- ensure
128
- @connection.disconnect
129
- end
121
+ raise EOFError unless @async.nil?
122
+
123
+ @connection = @channel.connect(self)
124
+ @async = Async.new
125
+ yield
126
+ @async.await
127
+ ensure
128
+ @connection.disconnect
130
129
  end
131
130
  end
132
131
 
@@ -84,9 +84,6 @@ module Sass
84
84
  importer: [])
85
85
  raise ArgumentError, 'either data or file must be set' if file.nil? && data.nil?
86
86
 
87
- require 'pathname'
88
- require 'uri'
89
-
90
87
  start = now
91
88
 
92
89
  indent_type = parse_indent_type(indent_type)
@@ -215,7 +212,6 @@ module Sass
215
212
  source_map_root:)
216
213
  return if map.nil? || map.empty?
217
214
 
218
- require 'base64'
219
215
  require 'json'
220
216
 
221
217
  map_data = JSON.parse(map)
@@ -272,6 +268,8 @@ module Sass
272
268
 
273
269
  unless map.nil? || omit_source_map_url == true
274
270
  url = if source_map_embed
271
+ require 'base64'
272
+
275
273
  "data:application/json;base64,#{Base64.strict_encode64(map)}"
276
274
  elsif out_file
277
275
  relative_path(File.dirname(out_file), source_map)
@@ -327,6 +325,8 @@ module Sass
327
325
 
328
326
  # @deprecated
329
327
  def relative_path(from, to)
328
+ require 'pathname'
329
+
330
330
  Pathname.new(File.absolute_path(to)).relative_path_from(Pathname.new(File.absolute_path(from))).to_s
331
331
  end
332
332
 
@@ -372,30 +372,33 @@ module Sass
372
372
  # @deprecated
373
373
  # The {Url} module.
374
374
  module Url
375
- # The {::URI::Parser} that is in consistent with RFC 2396 (URI Generic Syntax) and dart:core library.
376
- URI_PARSER = URI::Parser.new({ RESERVED: ';/?:@&=+$,' })
377
-
378
375
  FILE_SCHEME = 'file://'
379
376
 
380
- private_constant :URI_PARSER, :FILE_SCHEME
377
+ private_constant :FILE_SCHEME
381
378
 
382
379
  module_function
383
380
 
384
381
  def path_to_file_url(path)
385
382
  if File.absolute_path? path
386
- URI_PARSER.escape "#{FILE_SCHEME}#{Gem.win_platform? ? '/' : ''}#{path}"
383
+ Url.uri_parser.escape "#{FILE_SCHEME}#{Gem.win_platform? ? '/' : ''}#{path}"
387
384
  else
388
- URI_PARSER.escape path
385
+ Url.uri_parser.escape path
389
386
  end
390
387
  end
391
388
 
392
389
  def file_url_to_path(url)
393
390
  if url.start_with? FILE_SCHEME
394
- 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))..]
395
392
  else
396
- URI_PARSER.unescape url
393
+ Url.uri_parser.unescape url
397
394
  end
398
395
  end
396
+
397
+ def uri_parser
398
+ require 'uri'
399
+
400
+ @uri_parser ||= URI::Parser.new({ RESERVED: ';/?:@&=+$,' })
401
+ end
399
402
  end
400
403
 
401
404
  private_constant :LegacyImporter
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sass
4
4
  class Embedded
5
- VERSION = '0.19.2'
5
+ VERSION = '0.19.5'
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.2
4
+ version: 0.19.5
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.2
167
- source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.2
166
+ documentation_uri: https://www.rubydoc.info/gems/sass-embedded/0.19.5
167
+ source_code_uri: https://github.com/ntkme/sass-embedded-host-ruby/tree/v0.19.5
168
168
  funding_uri: https://github.com/sponsors/ntkme
169
169
  post_install_message:
170
170
  rdoc_options: []