Parent

Class/Module Index [+]

Quicksearch

Nanoc::CLI::Commands::Compile::Listener

Listens to compilation events and reacts to them. This abstract class does not have a real implementation; subclasses should override {start} and set up notifications to listen to.

@abstract Subclasses must override {start} and may override {stop}.

Public Class Methods

enable_for?(command_runner) click to toggle source

@param [Nanoc::CLI::CommandRunner] command_runner The command runner for this listener

@return [Boolean] true if this listener should be enabled for the given command runner, false otherwise

@abstract Returns `true` by default, but subclasses may override this.

# File lib/nanoc/cli/commands/compile.rb, line 43
def self.enable_for?(command_runner)
  true
end
new(params={}) click to toggle source
# File lib/nanoc/cli/commands/compile.rb, line 35
def initialize(params={})
end

Public Instance Methods

start() click to toggle source

Starts the listener. Subclasses should override this method and set up listener notifications.

@return [void]

@abstract

# File lib/nanoc/cli/commands/compile.rb, line 52
def start
  raise NotImplementedError, "Subclasses of Listener should implement #start"
end
stop() click to toggle source

Stops the listener. The default implementation removes self from all notification center observers.

@return [void]

# File lib/nanoc/cli/commands/compile.rb, line 59
def stop
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.