class Guard::JekyllPlus::Builder::Rebuilder
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
Guard::JekyllPlus::Builder::Action::new
# File lib/guard/jekyll_plus/builder/rebuilder.rb, line 9 def initialize(*args) @name = 'build' @activity = 'building...' @color = :yellow super end
Public Instance Methods
benchmark() { || ... }
click to toggle source
# File lib/guard/jekyll_plus/builder/rebuilder.rb, line 28 def benchmark elapsed = Benchmark.realtime { yield }.round(2) change = format('%s → %s', @config.source, @config.destination) msg = format('build completed in %ss '.green + change, elapsed) @config.info msg end
update()
click to toggle source
# File lib/guard/jekyll_plus/builder/rebuilder.rb, line 16 def update header(nil) benchmark { @site.process } # rescue almost everything because Jekyll::Convertible forwards # every plugin-specific exception it encounters rescue StandardError => e @config.error "#{@name} has failed" @config.error e.to_s throw :task_has_failed end