Class: Middleman::Diff::Extension
- Inherits:
-
Extension
- Object
- Extension
- Middleman::Diff::Extension
- Defined in:
- lib/middleman-diff/extension.rb
Overview
Middleman extension
Instance Method Summary collapse
-
#initialize(app, **options_hash, &block) ⇒ void
constructor
Runs when the extension is activated.
-
#with_preview {|Middleman::Diff::Preview| ... } ⇒ void
Yield a preview of the build.
Constructor Details
#initialize(app, **options_hash, &block) ⇒ void
Runs when the extension is activated
20 21 22 23 24 25 26 |
# File 'lib/middleman-diff/extension.rb', line 20 def initialize(app, **, &block) # Build options from options_hash super require 'middleman-diff/preview' require 'pathname' end |
Instance Method Details
#with_preview {|Middleman::Diff::Preview| ... } ⇒ void
This method returns an undefined value.
Yield a preview of the build.
33 34 35 36 37 38 39 40 |
# File 'lib/middleman-diff/extension.rb', line 33 def with_preview preview = Preview.new(app, build_hooks: .build_hooks, temp_dir: .temp_dir) yield preview preview.dispose end |