Class: Middleman::BuildReporterExtension

Inherits:
Extension
  • Object
show all
Defined in:
lib/middleman-build-reporter/extension.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options_hash = {}, &block) ⇒ BuildReporterExtension

Returns a new instance of BuildReporterExtension.



8
9
10
11
12
13
# File 'lib/middleman-build-reporter/extension.rb', line 8

def initialize(app, options_hash = {}, &block)
  super

  @app = app
  @app.set :build_report, Middleman::BuildReporter::Reporter.new(@app, options)
end

Instance Method Details

#after_build(builder) ⇒ Object



15
16
17
18
19
# File 'lib/middleman-build-reporter/extension.rb', line 15

def after_build(builder)
  @app.build_report.write do |file|
    builder.say_status :create, file, :green
  end
end