Class: Nanoc::CLI::Commands::Compile::Listener Abstract
- Inherits:
-
Object
- Object
- Nanoc::CLI::Commands::Compile::Listener
- Defined in:
- lib/nanoc/cli/commands/compile.rb
Overview
Direct Known Subclasses
DebugPrinter, DiffGenerator, FileActionPrinter, GCController, TimingRecorder
Class Method Summary collapse
-
.enable_for?(command_runner) ⇒ Boolean
abstract
True if this listener should be enabled for the given command runner, false otherwise.
Instance Method Summary collapse
-
#initialize ⇒ Listener
constructor
A new instance of Listener.
-
#start ⇒ void
abstract
Starts the listener.
-
#stop ⇒ void
Stops the listener.
Constructor Details
#initialize ⇒ Listener
Returns a new instance of Listener
26 27 |
# File 'lib/nanoc/cli/commands/compile.rb', line 26 def initialize(*) end |
Class Method Details
.enable_for?(command_runner) ⇒ Boolean
This method is abstract.
Returns true
by default, but subclasses may override this.
Returns true if this listener should be enabled for the given command runner, false otherwise
34 35 36 |
# File 'lib/nanoc/cli/commands/compile.rb', line 34 def self.enable_for?(command_runner) # rubocop:disable Lint/UnusedMethodArgument true end |
Instance Method Details
#start ⇒ void
This method is abstract.
This method returns an undefined value.
Starts the listener. Subclasses should override this method and set up listener notifications.
43 44 45 |
# File 'lib/nanoc/cli/commands/compile.rb', line 43 def start raise NotImplementedError, 'Subclasses of Listener should implement #start' end |
#stop ⇒ void
This method returns an undefined value.
Stops the listener. The default implementation removes self from all notification center observers.
50 51 |
# File 'lib/nanoc/cli/commands/compile.rb', line 50 def stop end |