Class: Nanoc3::Filters::CacheBuster
- Inherits:
-
Nanoc3::Filter
- Object
- Nanoc3::Filter
- Nanoc3::Filters::CacheBuster
- Defined in:
- lib/nanoc3/filters/cache_buster.rb
Instance Method Summary collapse
Instance Method Details
#run(content, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nanoc3/filters/cache_buster.rb', line 6 def run(content, = {}) kind = [:strategy] || (stylesheet? ? :css : :html) strategy = Nanoc3::Cachebuster::Strategy.for(kind , site, item) content.gsub(strategy.class::REGEX) do |m| begin strategy.apply m, $1, $2, $3, $4 rescue Nanoc3::Cachebuster::NoSuchSourceFile m end end end |