Class: Nanoc::Filters::CacheBuster
- Inherits:
-
Nanoc::Filter
- Object
- Nanoc::Filter
- Nanoc::Filters::CacheBuster
- Defined in:
- lib/nanoc/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/nanoc/filters/cache_buster.rb', line 6 def run(content, = {}) kind = [:strategy] || (stylesheet? ? :css : :html) strategy = Nanoc::Cachebuster::Strategy.for(kind , site, item) content.gsub(strategy.class::REGEX) do |m| begin strategy.apply m, $1, $2, $3, $4 rescue Nanoc::Cachebuster::NoSuchSourceFile m end end end |