Class: ReActionView::AssetManifest
- Inherits:
-
Object
- Object
- ReActionView::AssetManifest
- Defined in:
- lib/reactionview/asset_manifest.rb
Instance Method Summary collapse
- #exist? ⇒ Boolean
- #explanation ⇒ Object
- #in_use? ⇒ Boolean
-
#initialize(assets) ⇒ AssetManifest
constructor
A new instance of AssetManifest.
- #missing_assets ⇒ Object
- #mtime ⇒ Object
- #path ⇒ Object
- #stale? ⇒ Boolean
Constructor Details
#initialize(assets) ⇒ AssetManifest
Returns a new instance of AssetManifest.
7 8 9 |
# File 'lib/reactionview/asset_manifest.rb', line 7 def initialize(assets) @assets = assets end |
Instance Method Details
#exist? ⇒ Boolean
27 28 29 |
# File 'lib/reactionview/asset_manifest.rb', line 27 def exist? !mtime.nil? end |
#explanation ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/reactionview/asset_manifest.rb', line 47 def explanation <<~MESSAGE ReActionView's dev tools assets are missing from your precompiled assets. #{status} To fix this, delete the precompiled assets: bin/rails assets:clobber That is safe in development. Without public/assets/, Propshaft serves each asset straight from the directory it lives in, including ReActionView's. Missing: #{missing_assets.join(", ")} Manifest: #{path} public/assets/ was most likely left behind by `RAILS_ENV=production bin/rails assets:precompile`, and a production precompile doesn't include ReActionView's dev tools. MESSAGE end |
#in_use? ⇒ Boolean
43 44 45 |
# File 'lib/reactionview/asset_manifest.rb', line 43 def in_use? @assets.respond_to?(:resolver) && @assets.resolver.respond_to?(:manifest_path) end |
#missing_assets ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/reactionview/asset_manifest.rb', line 31 def missing_assets precompiled = logical_paths return [] if precompiled.empty? ReActionView::Railtie::PRECOMPILE_ASSETS - precompiled end |
#mtime ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/reactionview/asset_manifest.rb', line 19 def mtime return if path.nil? File.mtime(path) rescue SystemCallError nil end |
#path ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/reactionview/asset_manifest.rb', line 11 def path config = @assets&.config return unless config.respond_to?(:manifest_path) config.manifest_path end |
#stale? ⇒ Boolean
39 40 41 |
# File 'lib/reactionview/asset_manifest.rb', line 39 def stale? exist? && !missing_assets.empty? end |