lib/middleman-webp/extension.rb in middleman-webp-0.2.3 vs lib/middleman-webp/extension.rb in middleman-webp-0.2.4
- old
+ new
@@ -1,17 +1,17 @@
-require "middleman-core"
-require "middleman-webp/converter"
+require 'middleman-core'
+require 'middleman-webp/converter'
module Middleman
class WebPExtension < Extension
- option :conversion_options, {}, "Custom conversion options for cwebp/gif2webp"
-
- def initialize(app, options_hash={}, &block)
+ option(:conversion_options, {},
+ 'Custom conversion options for cwebp/gif2webp')
+ option(:ignore, [], 'Ignores files with matching paths')
+ def initialize(app, options_hash = {}, &block)
super
- args = options.conversion_options
app.after_build do |builder|
- Middleman::WebP::Converter.new(app, args, builder).convert
+ Middleman::WebP::Converter.new(app, options_hash, builder).convert
end
end
end
end