Module: RevManifest
- Defined in:
- lib/rev_manifest/helper.rb,
lib/rev_manifest/railtie.rb,
lib/rev_manifest/version.rb,
lib/actionview-rev_manifest.rb
Defined Under Namespace
Modules: Helper Classes: Railtie
Constant Summary collapse
- VERSION =
"0.2.2"
- DEFAULT_ASSET_PUBLIC_DIRECTORIES =
{ audio: "/assets/audios", font: "/assets/fonts", image: "/assets/images", javascript: "/assets/javascripts", stylesheet: "/assets/stylesheets", video: "/assets/videos" }
- DEFAULT_ASSET_PREFIXES =
{ audio: "assets/audios/", font: "assets/fonts/", image: "assets/images/", javascript: "assets/javascripts/", stylesheet: "assets/stylesheets/", video: "assets/videos/" }
- DEFAULT_ASSET_ROOT =
"/"
- DEFAULT_MANIFEST_PATH =
"public/assets/rev-manifest.json"
Class Attribute Summary collapse
-
.asset_prefixes ⇒ Object
writeonly
Sets the attribute asset_prefixes.
- .asset_public_directories ⇒ Hash
-
.asset_root ⇒ Object
writeonly
Sets the attribute asset_root.
-
.enabled ⇒ Object
writeonly
Sets the attribute enabled.
-
.manifest_path ⇒ Object
writeonly
Sets the attribute manifest_path.
-
.sources ⇒ Object
writeonly
Sets the attribute sources.
Class Method Summary collapse
-
.enabled? ⇒ Boolean
@return [true, false].
- .include?(source) ⇒ true, false
- .resolve(source, options) ⇒ String
Class Attribute Details
.asset_prefixes=(value) ⇒ Object
Sets the attribute asset_prefixes
28 29 30 |
# File 'lib/actionview-rev_manifest.rb', line 28 def asset_prefixes=(value) @asset_prefixes = value end |
.asset_public_directories ⇒ Hash
37 38 39 |
# File 'lib/actionview-rev_manifest.rb', line 37 def asset_public_directories @asset_public_directories || DEFAULT_ASSET_PUBLIC_DIRECTORIES end |
.asset_root=(value) ⇒ Object
Sets the attribute asset_root
28 29 30 |
# File 'lib/actionview-rev_manifest.rb', line 28 def asset_root=(value) @asset_root = value end |
.enabled=(value) ⇒ Object (writeonly)
Sets the attribute enabled
28 29 30 |
# File 'lib/actionview-rev_manifest.rb', line 28 def enabled=(value) @enabled = value end |
.manifest_path=(value) ⇒ Object
Sets the attribute manifest_path
28 29 30 |
# File 'lib/actionview-rev_manifest.rb', line 28 def manifest_path=(value) @manifest_path = value end |
.sources=(value) ⇒ Object (writeonly)
Sets the attribute sources
28 29 30 |
# File 'lib/actionview-rev_manifest.rb', line 28 def sources=(value) @sources = value end |
Class Method Details
.enabled? ⇒ Boolean
@return [true, false]
32 33 34 |
# File 'lib/actionview-rev_manifest.rb', line 32 def enabled? !!@enabled end |
.include?(source) ⇒ true, false
42 43 44 45 |
# File 'lib/actionview-rev_manifest.rb', line 42 def include?(source) return false unless @sources @sources == :all ? true : @sources.include?(source) end |
.resolve(source, options) ⇒ String
48 49 50 |
# File 'lib/actionview-rev_manifest.rb', line 48 def resolve(source, ) asset_root + manifest[asset_prefixes[[:type]] + source] end |