external_asset_pipeline 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/external_asset_pipeline/helper.rb +9 -2
- data/lib/external_asset_pipeline/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 938503884a15e3190f4827ac9c9bae8b495806ab6c94e96d2046e1af060f0959
|
4
|
+
data.tar.gz: 0eb9c4051a506b8b67e7e1b1024f0b4a695f5075dc48420286607f02767d0420
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b376bce88612967eee762d4c233a03ed271bfbeabcd69b74f87b5a6a518b8abefdba70e3d4e0a8f514bb11aca75066604b82f2ed4a2b47b71b070078a8a3e2f
|
7
|
+
data.tar.gz: 2cbbc2528ed5469a7bc21a3890b50a55b1c4827efb6fc10c66174b2b2ee391706cd4e5b0080a83ed5954f7f7f9703cb57515b265bae6b6cb342d54c34ffb348e
|
@@ -4,17 +4,24 @@ require 'external_asset_pipeline'
|
|
4
4
|
|
5
5
|
module ExternalAssetPipeline
|
6
6
|
module Helper
|
7
|
+
# This helper method can be overridden to return a different Manifest
|
8
|
+
# instance, e.g. to have distinct instances in different rails engines.
|
9
|
+
def external_asset_pipeline_manifest
|
10
|
+
ExternalAssetPipeline.manifest
|
11
|
+
end
|
12
|
+
|
7
13
|
# Overrides the built-in
|
8
14
|
# `ActionView::Helpers::AssetUrlHelper#compute_asset_path` to use the
|
9
15
|
# external asset pipeline, in the same manner that sprockets-rails does:
|
10
16
|
# https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/rails/helper.rb#L74-L96
|
11
17
|
def compute_asset_path(source, options = {})
|
12
|
-
|
18
|
+
manifest = external_asset_pipeline_manifest
|
19
|
+
asset = manifest.find(source)
|
13
20
|
|
14
21
|
options[:host] = asset[:host] if asset && asset[:host]
|
15
22
|
|
16
23
|
return asset[:path] if asset
|
17
|
-
return super if
|
24
|
+
return super if manifest.fall_back_to_sprockets?
|
18
25
|
|
19
26
|
raise AssetNotFound,
|
20
27
|
"The asset #{source.inspect} is not present in the asset manifest"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: external_asset_pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Macklin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -56,8 +56,8 @@ licenses:
|
|
56
56
|
- MIT
|
57
57
|
metadata:
|
58
58
|
homepage_uri: https://github.com/rails-front-end/external_asset_pipeline
|
59
|
-
source_code_uri: https://github.com/rails-front-end/external_asset_pipeline/tree/v0.
|
60
|
-
changelog_uri: https://github.com/rails-front-end/external_asset_pipeline/blob/v0.
|
59
|
+
source_code_uri: https://github.com/rails-front-end/external_asset_pipeline/tree/v0.5.0
|
60
|
+
changelog_uri: https://github.com/rails-front-end/external_asset_pipeline/blob/v0.5.0/CHANGELOG.md
|
61
61
|
post_install_message:
|
62
62
|
rdoc_options: []
|
63
63
|
require_paths:
|