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 313 def initialize(params={}) @rep_times = {} @reps = params.fetch(:reps) end
@see Listener#start
# File lib/nanoc/cli/commands/compile.rb, line 320 def start Nanoc::NotificationCenter.on(:compilation_started) do |rep| @rep_times[rep.raw_path] = Time.now end Nanoc::NotificationCenter.on(:compilation_ended) do |rep| @rep_times[rep.raw_path] = Time.now - @rep_times[rep.raw_path] end Nanoc::NotificationCenter.on(:rep_written) do |rep, path, is_created, is_modified| action = (is_created ? :create : (is_modified ? :update : :identical)) level = (is_created ? :high : (is_modified ? :high : :low)) duration = Time.now - @rep_times[rep.raw_path] if @rep_times[rep.raw_path] Nanoc::CLI::Logger.instance.file(level, action, path, duration) end end
@see Listener#stop
# File lib/nanoc/cli/commands/compile.rb, line 336 def stop super @reps.select { |r| !r.compiled? }.each do |rep| rep.raw_paths.each do |snapshot_name, filename| next if filename.nil? duration = @rep_times[filename] Nanoc::CLI::Logger.instance.file(:high, :skip, filename, duration) end end end
Generated with the Darkfish Rdoc Generator 2.