actionview-rev_manifest 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/actionview-rev_manifest.rb +18 -4
- data/lib/rev_manifest/actionview/base.rb +1 -1
- data/lib/rev_manifest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19fc5493ff6fca5a2b782d925ebd71af778045b9
|
4
|
+
data.tar.gz: 14fc56cfa00c6eff27cb99b46674d9785e5fddd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 986af713c99e3bba885012c2afa9783b2c376fa6fe9ec87e2a7eaacf5a6292e5f3a2d2b2d8993c0864d32334cd599c448d7842f18d935a07157dc2224890c9e5
|
7
|
+
data.tar.gz: 6cdb8657f864d1bd1bd86b5e1307236acad597af6596accf0075e765fc8fc3f58289923ba07c6f89aa0bade329e2f5fa33f924933a05e2de90cc0a3e149c27ca
|
@@ -20,24 +20,38 @@ module RevManifest
|
|
20
20
|
video: "assets/videos/"
|
21
21
|
}
|
22
22
|
|
23
|
+
DEFAULT_ASSET_ROOT = "/"
|
24
|
+
|
23
25
|
DEFAULT_MANIFEST_PATH = "public/assets/rev-manifest.json"
|
24
26
|
|
25
27
|
class << self
|
26
|
-
attr_writer :enabled, :asset_prefixes, :asset_public_directories, :manifest_path
|
28
|
+
attr_writer :enabled, :asset_prefixes, :asset_public_directories, :asset_root, :manifest_path
|
27
29
|
|
28
30
|
# @return [true, false]
|
29
31
|
def enabled?
|
30
32
|
!!@enabled
|
31
33
|
end
|
32
34
|
|
35
|
+
# @return [Hash]
|
36
|
+
def asset_public_directories
|
37
|
+
@asset_public_directories || DEFAULT_ASSET_PUBLIC_DIRECTORIES
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
def resolve(source, options)
|
42
|
+
asset_root + manifest[asset_prefixes[options[:type]] + source]
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
33
47
|
# @return [Hash]
|
34
48
|
def asset_prefixes
|
35
49
|
@asset_prefixes || DEFAULT_ASSET_PREFIXES
|
36
50
|
end
|
37
51
|
|
38
|
-
# @return [
|
39
|
-
def
|
40
|
-
@
|
52
|
+
# @return [String]
|
53
|
+
def asset_root
|
54
|
+
@asset_root || DEFAULT_ASSET_ROOT
|
41
55
|
end
|
42
56
|
|
43
57
|
# @return [String]
|
@@ -3,7 +3,7 @@ module ActionView
|
|
3
3
|
# @note Override {ActionView::Helpers::AssetUrlHelper#compute_asset_path}.
|
4
4
|
def compute_asset_path(source, options = {})
|
5
5
|
if RevManifest.enabled?
|
6
|
-
|
6
|
+
Revmanifest.resolve(source, options)
|
7
7
|
else
|
8
8
|
dir = RevManifest.asset_public_directories[options[:type]] || ""
|
9
9
|
File.join(dir, source)
|
data/lib/rev_manifest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionview-rev_manifest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuku Takahashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|