rails-assets-manifest 2.1.1 → 2.1.2
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/CHANGELOG.md +7 -0
- data/lib/rails/assets/manifest/helper.rb +20 -0
- data/lib/rails/assets/manifest/railtie.rb +2 -2
- data/lib/rails/assets/manifest/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: f74ada8a7abade960a8bbb990ef4bcf5b9f042e09024d1de5b39cbf1a2ccf1ec
|
4
|
+
data.tar.gz: d45b22c32fe3981382d47c9680e3102e48c2d30211c24a1eac1e7baab8cd24a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d993c84c80510ab83df09c15838c8a07fc909d8d90b7891f340fb7501319bbac75d934d8f5fbfc52864d62ed47c560da9bbd93687b2d9dc5ce3d8d6abac94ec1
|
7
|
+
data.tar.gz: a6543487813204d1061a4db57edaaa3fe721c90b51f71ca787d2d858873719491a71e159ffa1618cb2edd5e579e77eefeb16771aff81313cdec9d66e2f36c421
|
data/CHANGELOG.md
CHANGED
@@ -17,6 +17,13 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
|
|
17
17
|
### Breaks
|
18
18
|
|
19
19
|
|
20
|
+
## 2.1.2 - (2021-09-05)
|
21
|
+
---
|
22
|
+
|
23
|
+
### Fixes
|
24
|
+
* Return correct fully qualified URLs from manifest when relative URL host or asset host is configured
|
25
|
+
|
26
|
+
|
20
27
|
## 2.1.1 - (2021-06-20)
|
21
28
|
---
|
22
29
|
|
@@ -2,6 +2,26 @@
|
|
2
2
|
|
3
3
|
module Rails::Assets::Manifest
|
4
4
|
module Helper
|
5
|
+
URI_REGEXP = %r{^[-a-z]+://|^(?:cid|data):|^//}i.freeze
|
6
|
+
|
7
|
+
def path_to_asset(source, options)
|
8
|
+
if (entry = ::Rails::Assets::Manifest.lookup(path_with_extname(source, options)))
|
9
|
+
# Directly return the entry src if it is a fully qualified URL. Otherwise,
|
10
|
+
# Rails will join the URL with `relative_url_root` and/or asset host.
|
11
|
+
return entry.src if URI_REGEXP.match?(entry.src)
|
12
|
+
|
13
|
+
if entry.src[0] == '/'
|
14
|
+
# When the asset name starts with a slash, Rails will skip an
|
15
|
+
# additional lookup via `#compute_asset_path` and directly use the
|
16
|
+
# provided path. As we already have looked up the manifest entry here,
|
17
|
+
# we can pass the entry source, but only *if* it starts with a slash.
|
18
|
+
return super entry.src, options
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
5
25
|
def compute_asset_path(name, _options)
|
6
26
|
::Rails::Assets::Manifest.lookup!(name).src
|
7
27
|
rescue EntryMissing
|
@@ -5,7 +5,7 @@ module Rails
|
|
5
5
|
module Manifest
|
6
6
|
class Railtie < ::Rails::Railtie
|
7
7
|
# If this plugin is used with sprockets this option
|
8
|
-
# already exists and must not be
|
8
|
+
# already exists and must not be overridden. Otherwise
|
9
9
|
# all sprockets default options are removed breaking
|
10
10
|
# sprockets.
|
11
11
|
config.assets = ::ActiveSupport::OrderedOptions.new unless config.respond_to?(:assets)
|
@@ -20,7 +20,7 @@ module Rails
|
|
20
20
|
|
21
21
|
config.after_initialize do |_|
|
22
22
|
ActiveSupport.on_load(:action_view) do
|
23
|
-
|
23
|
+
prepend Helper
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-assets-manifest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
|
-
rubygems_version: 3.2.
|
107
|
+
rubygems_version: 3.2.22
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Load all rails assets from an external manifest.
|