Sha256: cd3a1bef226bdd5bc135dffba8307cdbd16329cf39a4beea71720fa111d3b22c

Contents?: true

Size: 1.35 KB

Versions: 32

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

module Nanoc::CLI::Commands::CompileListeners
  class DebugPrinter < Abstract
    # @see Listener#enable_for?
    def self.enable_for?(command_runner, _site)
      command_runner.debug?
    end

    # @see Listener#start
    def start
      Nanoc::Int::NotificationCenter.on(:compilation_started) do |rep|
        puts "*** Started compilation of #{rep.inspect}"
      end
      Nanoc::Int::NotificationCenter.on(:compilation_ended) do |rep|
        puts "*** Ended compilation of #{rep.inspect}"
        puts
      end
      Nanoc::Int::NotificationCenter.on(:compilation_suspended) do |rep, e|
        puts "*** Suspended compilation of #{rep.inspect}: #{e.message}"
      end
      Nanoc::Int::NotificationCenter.on(:cached_content_used) do |rep|
        puts "*** Used cached compiled content for #{rep.inspect} instead of recompiling"
      end
      Nanoc::Int::NotificationCenter.on(:filtering_started) do |rep, filter_name|
        puts "*** Started filtering #{rep.inspect} with #{filter_name}"
      end
      Nanoc::Int::NotificationCenter.on(:filtering_ended) do |rep, filter_name|
        puts "*** Ended filtering #{rep.inspect} with #{filter_name}"
      end
      Nanoc::Int::NotificationCenter.on(:dependency_created) do |src, dst|
        puts "*** Dependency created from #{src.inspect} onto #{dst.inspect}"
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
nanoc-4.11.0 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.10.4 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.10.3 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.10.2 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.10.1 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.10.0 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.9 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.8 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.7 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.6 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.5 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.4 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.3 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.2 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.1 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.9.0 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.8.19 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.8.18 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.8.17 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb
nanoc-4.8.16 lib/nanoc/cli/commands/compile_listeners/debug_printer.rb