utopia 3.0.2 → 3.0.3
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
- checksums.yaml.gz.sig +0 -0
- data/lib/utopia/import_map.rb +6 -10
- data/lib/utopia/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c16b554d772d132bd1820ec17f402bbdf2d3720a5c6965f8673c0f06054f1c29
|
|
4
|
+
data.tar.gz: d6d839b6d55e3aff38507b9c4324d2631eb5a6b7f64eaeddb7e6b30185409b0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ab0202e8f8259c62856341332dcc7f37532535e968e90b75dceb4e8370eee7092ac5e7cdc4e3a2072f0394ba87b39994c18fa2ca1f17864d9f04f5974847a9b2
|
|
7
|
+
data.tar.gz: 14260960ab36d1cea1cabc02b6c43c29661efefb6e3e1566ef7e61ce87ba9f6525e111f9182e3beeac0a973bf303c147a71d3edc65d1cb75153c3c7377e7f2a8
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/utopia/import_map.rb
CHANGED
|
@@ -268,13 +268,7 @@ module Utopia
|
|
|
268
268
|
# page_map = import_map.relative_to("/foo/bar/")
|
|
269
269
|
# # Base becomes: "../../_components/"
|
|
270
270
|
def relative_to(path)
|
|
271
|
-
|
|
272
|
-
# Calculate the relative path from the page to the base
|
|
273
|
-
relative_path = @base.path.relative(path)
|
|
274
|
-
resolved_base = Protocol::URL::Relative.new(relative_path)
|
|
275
|
-
else
|
|
276
|
-
resolved_base = nil
|
|
277
|
-
end
|
|
271
|
+
resolved_base = @base&.relative_to(path)
|
|
278
272
|
|
|
279
273
|
instance = self.class.new(@imports.dup, @integrity.dup, @scopes.dup, base: resolved_base)
|
|
280
274
|
|
|
@@ -285,10 +279,12 @@ module Utopia
|
|
|
285
279
|
#
|
|
286
280
|
# @parameter value [String] The import URL or path value.
|
|
287
281
|
# @parameter base [Protocol::URL | Nil] The base URL context for resolving relative paths.
|
|
288
|
-
# @returns [Protocol::URL
|
|
282
|
+
# @returns [Protocol::URL] The resolved URL.
|
|
289
283
|
private def resolve_value(value, base)
|
|
284
|
+
value = Protocol::URL[value]
|
|
285
|
+
|
|
290
286
|
if base
|
|
291
|
-
base +
|
|
287
|
+
base + value
|
|
292
288
|
else
|
|
293
289
|
value
|
|
294
290
|
end
|
|
@@ -303,7 +299,7 @@ module Utopia
|
|
|
303
299
|
result = {}
|
|
304
300
|
|
|
305
301
|
imports.each do |specifier, value|
|
|
306
|
-
result[specifier] = resolve_value(value, base).to_s
|
|
302
|
+
result[specifier] = resolve_value(value, base).to_s(explicit: true)
|
|
307
303
|
end
|
|
308
304
|
|
|
309
305
|
result
|
data/lib/utopia/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: utopia
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -203,14 +203,14 @@ dependencies:
|
|
|
203
203
|
requirements:
|
|
204
204
|
- - "~>"
|
|
205
205
|
- !ruby/object:Gem::Version
|
|
206
|
-
version: '0.
|
|
206
|
+
version: '0.18'
|
|
207
207
|
type: :runtime
|
|
208
208
|
prerelease: false
|
|
209
209
|
version_requirements: !ruby/object:Gem::Requirement
|
|
210
210
|
requirements:
|
|
211
211
|
- - "~>"
|
|
212
212
|
- !ruby/object:Gem::Version
|
|
213
|
-
version: '0.
|
|
213
|
+
version: '0.18'
|
|
214
214
|
- !ruby/object:Gem::Dependency
|
|
215
215
|
name: samovar
|
|
216
216
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
|
Binary file
|