asset_paths_from_manifest 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c633fc840d5259f33e52c5dae75b9270dbc069b
|
4
|
+
data.tar.gz: ebd9cbc3c802a8a8642c8b68644eec1426130cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b03b8197cba3967ce411239e9b73dbad7f5ace1b639365472034492da7defe9ad70fbf6b177cc8743026dd2bb5e5d2351c0693542d18526e7b5de825d2e7d103
|
7
|
+
data.tar.gz: f3d70dcdbf646e4ec44a3af3a76a3a94d95dcfc3f6ba6739c02ee0a0eb7c85d9f1b99f24b56cefa636b891e16fa2f8b3fdc6bd18a72b9d931977dd0804d17714
|
@@ -1,10 +1,12 @@
|
|
1
1
|
require "asset_paths_from_manifest/version"
|
2
2
|
|
3
3
|
module AssetPathsFromManifest
|
4
|
-
|
4
|
+
class << self
|
5
|
+
attr_reader :manifest
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
def bootstrap
|
8
|
+
@manifest = Manifest.load
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
@@ -14,10 +14,10 @@ module AssetPathsFromManifest
|
|
14
14
|
end
|
15
15
|
|
16
16
|
class Config
|
17
|
-
|
17
|
+
attr_accessor :manifest_json_path
|
18
18
|
|
19
|
-
|
20
|
-
Rails.root.join('public', 'assets', 'manifest.json')
|
19
|
+
def initialize
|
20
|
+
@manifest_json_path = Rails.root.join('public', 'assets', 'manifest.json')
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -17,12 +17,8 @@ module AssetPathsFromManifest
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def lookup(name, type: nil)
|
20
|
-
name_with_extname = compute_asset_extname(name, type)
|
21
|
-
manifest.lookup(name_with_extname)
|
22
|
-
end
|
23
|
-
|
24
|
-
def manifest
|
25
|
-
AssetPathsFromManifest.manifest
|
20
|
+
name_with_extname = compute_asset_extname(name, type: type)
|
21
|
+
AssetPathsFromManifest.manifest.lookup(name_with_extname)
|
26
22
|
end
|
27
23
|
end
|
28
24
|
end
|
@@ -8,11 +8,11 @@ module AssetPathsFromManifest
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def file_path
|
11
|
-
AssetPathsFromManifest
|
11
|
+
AssetPathsFromManifest.configuration.manifest_json_path
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def initialize(json_path)
|
16
16
|
@json_path = json_path
|
17
17
|
@data = load
|
18
18
|
end
|