proscenium 0.22.5 → 0.22.6
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/proscenium/ext/proscenium +0 -0
- data/lib/proscenium/resolver.rb +16 -19
- data/lib/proscenium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b42a3d7e81b82be5157c35eafcb6e4a44a220956201026063f3049ab947fad2
|
|
4
|
+
data.tar.gz: cbd55dfbe3c9c9efa8ffc5ec76486d73ba3fc3aceb4b8ae5d2fe8c5fbc7e0369
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bb3a8972d11b64e340538f60cbf46612b0166d6fb997cd6850bd692dbe4ea4ebb4fb5472b692a7dbe2b66a27925e8a1eb0f8e78d107827c9a1fbf0bda397022
|
|
7
|
+
data.tar.gz: a5e10df8a12b50a1eddf0aec340760864fd4b174063282f677df62d64bff444a1dc23d8b80936cae79084e3cc153e8c88e22e78f543e6525c2c340e7ea08d0e8
|
|
Binary file
|
data/lib/proscenium/resolver.rb
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'active_support/current_attributes'
|
|
4
|
-
|
|
5
3
|
module Proscenium
|
|
6
|
-
class Resolver
|
|
7
|
-
|
|
8
|
-
mattr_accessor :resolved if Rails.env.production?
|
|
4
|
+
class Resolver
|
|
5
|
+
mattr_accessor :resolved, instance_accessor: false, default: {}
|
|
9
6
|
|
|
10
7
|
# Resolve the given `path` to a fully qualified URL path.
|
|
11
8
|
#
|
|
12
|
-
# TODO: cache this across requests in production.
|
|
13
|
-
#
|
|
14
9
|
# @param path [String] URL path, file system path, or bare specifier (ie. NPM package).
|
|
15
10
|
# @param as_array [Boolean] whether or not to return the manifest path, non-manifest path, and
|
|
16
11
|
# absolute file system path as an array. Only returns the resolved path if false (default).
|
|
17
12
|
# @return [String, Array<String>]
|
|
18
13
|
def self.resolve(path, as_array: false)
|
|
19
|
-
self.resolved ||= {}
|
|
20
|
-
|
|
21
14
|
if path.start_with?('./', '../')
|
|
22
15
|
raise ArgumentError, '`path` must be an absolute file system or URL path'
|
|
23
16
|
end
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
resolved[path] ||= if (gem = BundledGems.paths.find { |_, v| path.start_with? "#{v}/" })
|
|
19
|
+
vpath = path.sub(/^#{gem.last}/, "@rubygems/#{gem.first}")
|
|
20
|
+
[Proscenium::Manifest[vpath], "/node_modules/#{vpath}", path]
|
|
21
|
+
elsif path.start_with?("#{Rails.root}/")
|
|
22
|
+
vpath = path.delete_prefix(Rails.root.to_s)
|
|
23
|
+
[Proscenium::Manifest[vpath], vpath, path]
|
|
24
|
+
else
|
|
25
|
+
[Proscenium::Manifest[path], *Builder.resolve(path)]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
as_array ? resolved[path] : resolved[path][0] || resolved[path][1]
|
|
29
|
+
end
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
def self.reset
|
|
32
|
+
self.resolved = {}
|
|
36
33
|
end
|
|
37
34
|
end
|
|
38
35
|
end
|
data/lib/proscenium/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: proscenium
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.22.
|
|
4
|
+
version: 0.22.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joel Moss
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|