Class: MiddlemanScavenger
- Inherits:
-
Middleman::Extension
- Object
- Middleman::Extension
- MiddlemanScavenger
- Defined in:
- lib/middleman-scavenger.rb
Overview
Extension namespace
Instance Method Summary collapse
-
#initialize(app, options_hash = {}, &block) ⇒ MiddlemanScavenger
constructor
A new instance of MiddlemanScavenger.
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ MiddlemanScavenger
Returns a new instance of MiddlemanScavenger.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/middleman-scavenger.rb', line 10 def initialize(app, ={}, &block) super require "svg_processor" processor_instance = SVGProcessor.new(.path, .prefix, .sprite_path) processor_instance.rebuild app.set :svg_processor, processor_instance app.set :svg_sprite_path, .sprite_path app.ready do files.changed do |file| if File.extname(file) == ".svg" svg_processor.rebuild end end files.deleted do |file| if File.extname(file) == ".svg" svg_processor.rebuild end end end end |