Class Nanoc3::PluginRegistry
In: lib/nanoc3/base/plugin_registry.rb
Parent: Object

The class responsible for keeping track of all loaded plugins, such as filters ({Nanoc3::Filter}), data sources ({Nanoc3::DataSource}) and VCSes ({Nanoc3::Extra::VCS}).

Methods

all   find   instance   named   new   register  

Classes and Modules

Module Nanoc3::PluginRegistry::PluginMethods

Public Class methods

Returns the shared {PluginRegistry} instance, creating it if none exists yet.

@return [Nanoc3::PluginRegistry] The shared plugin registry

Creates a new plugin registry. This should usually not be necessary; it is recommended to use the shared instance (obtained from {Nanoc3::PluginRegistry.instance}).

Public Instance methods

Returns a list of all plugins. The returned list of plugins is an array with array elements in the following format:

  { :class => ..., :superclass => ..., :identifiers => ... }

@return [Array<Hash>] A list of all plugins in the format described

Finds the plugin that is a subclass of the given class and has the given name.

@param [Symbol] name The name of the plugin to return

@return [Class, nil] The plugin with the given name

@deprecated Use {Nanoc3::PluginRegistry#find} instead

Registers the given class as a plugin.

@param [Class] superclass The superclass of the plugin. For example: {Nanoc3::Filter}, {Nanoc3::Extra::VCS}.

@param [Class, String] class_or_name The class to register. This can be a string, in which case it will be automatically converted to a proper class at lookup. For example: `Nanoc3::Filters::ERB`, `"Nanoc3::Filters::Haml"`.

@param [Symbol] identifiers One or more symbols identifying the class. For example: `:haml`, :`erb`.

@return [void]

[Validate]