Class: Shakapacker::DigestStrategy
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- Shakapacker::DigestStrategy
- Defined in:
- lib/shakapacker/digest_strategy.rb
Instance Method Summary collapse
- #after_compile_hook ⇒ Object
-
#fresh? ⇒ Boolean
Returns true if all the compiled packs are up to date with the underlying asset files.
-
#stale? ⇒ Boolean
Returns true if the compiled packs are out of date with the underlying asset files.
Methods inherited from BaseStrategy
Constructor Details
This class inherits a constructor from Shakapacker::BaseStrategy
Instance Method Details
#after_compile_hook ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/shakapacker/digest_strategy.rb', line 16 def after_compile_hook # We used to only record the digest on success # However, the output file is still written on error, meaning that the digest should still be updated. # If it's not, you can end up in a situation where a recompile doesn't take place when it should. # See https://github.com/rails/webpacker/issues/2113 record_compilation_digest end |
#fresh? ⇒ Boolean
Returns true if all the compiled packs are up to date with the underlying asset files.
7 8 9 |
# File 'lib/shakapacker/digest_strategy.rb', line 7 def fresh? last_compilation_digest&.== watched_files_digest end |
#stale? ⇒ Boolean
Returns true if the compiled packs are out of date with the underlying asset files.
12 13 14 |
# File 'lib/shakapacker/digest_strategy.rb', line 12 def stale? !fresh? end |