Class: Nanoc::CLI::Commands::Compile::DebugPrinter
- Inherits:
-
Listener
- Object
- Listener
- Nanoc::CLI::Commands::Compile::DebugPrinter
- Defined in:
- lib/nanoc/cli/commands/compile.rb
Overview
Prints debug information (compilation started/ended, filtering started/ended, …)
Class Method Summary (collapse)
Instance Method Summary (collapse)
Methods inherited from Listener
Constructor Details
This class inherits a constructor from Nanoc::CLI::Commands::Compile::Listener
Class Method Details
+ (Boolean) enable_for?(command_runner)
290 291 292 |
# File 'lib/nanoc/cli/commands/compile.rb', line 290 def self.enable_for?(command_runner) command_runner.debug? end |
Instance Method Details
- (Object) start
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/nanoc/cli/commands/compile.rb', line 295 def start Nanoc::NotificationCenter.on(:compilation_started) do |rep| puts "*** Started compilation of #{rep.inspect}" end Nanoc::NotificationCenter.on(:compilation_ended) do |rep| puts "*** Ended compilation of #{rep.inspect}" puts end Nanoc::NotificationCenter.on(:compilation_failed) do |rep, e| puts "*** Suspended compilation of #{rep.inspect}: #{e.}" end Nanoc::NotificationCenter.on(:cached_content_used) do |rep| puts "*** Used cached compiled content for #{rep.inspect} instead of recompiling" end Nanoc::NotificationCenter.on(:filtering_started) do |rep, filter_name| puts "*** Started filtering #{rep.inspect} with #{filter_name}" end Nanoc::NotificationCenter.on(:filtering_ended) do |rep, filter_name| puts "*** Ended filtering #{rep.inspect} with #{filter_name}" end Nanoc::NotificationCenter.on(:visit_started) do |item| puts "*** Started visiting #{item.inspect}" end Nanoc::NotificationCenter.on(:visit_ended) do |item| puts "*** Ended visiting #{item.inspect}" end Nanoc::NotificationCenter.on(:dependency_created) do |src, dst| puts "*** Dependency created from #{src.inspect} onto #{dst.inspect}" end end |