Module: Nanoc3::Helpers::CacheBusting
- Defined in:
- lib/nanoc3/helpers/cache_busting.rb
Instance Method Summary collapse
-
#cachebust?(item) ⇒ Boolean
Test if we want to filter the output filename for a given item.
-
#fingerprint(filename) ⇒ String
Get a unique fingerprint for a file’s content.
Instance Method Details
#cachebust?(item) ⇒ Boolean
Test if we want to filter the output filename for a given item. This is logic used in the Rules file, but doesn’t belong there.
17 18 19 |
# File 'lib/nanoc3/helpers/cache_busting.rb', line 17 def cachebust?(item) Nanoc3::Cachebuster.should_apply_fingerprint_to_file?(item) end |
#fingerprint(filename) ⇒ String
TODO:
Also allow passing in an item rather than a path
Get a unique fingerprint for a file’s content. This currently uses an MD5 hash of the file contents.
27 28 29 |
# File 'lib/nanoc3/helpers/cache_busting.rb', line 27 def fingerprint(filename) Nanoc3::Cachebuster.fingerprint_file(filename) end |