Prints file actions (created, updated, deleted, identical, skipped)
@option params [Array<Nanoc::ItemRep>] :reps The list of item representations in the site
# File lib/nanoc/cli/commands/compile.rb, line 332 def initialize(params = {}) @start_times = {} @reps = params.fetch(:reps) end
@see Listener#start
# File lib/nanoc/cli/commands/compile.rb, line 339 def start Nanoc::NotificationCenter.on(:compilation_started) do |rep| @start_times[rep.raw_path] = Time.now end Nanoc::NotificationCenter.on(:rep_written) do |rep, path, is_created, is_modified| duration = path && @start_times[path] ? Time.now - @start_times[path] : nil action = case when is_created then :create when is_modified then :update else :identical end level = case when is_created then :high when is_modified then :high else :low end log(level, action, path, duration) end end
@see Listener#stop
# File lib/nanoc/cli/commands/compile.rb, line 362 def stop super @reps.select { |r| !r.compiled? }.each do |rep| rep.raw_paths.each do |snapshot_name, raw_path| log(:low, :skip, raw_path, nil) end end end
Generated with the Darkfish Rdoc Generator 2.