Module: RUtilAnts::Plugins

Defined in:
lib/rUtilAnts/Plugins.rb

Overview

Module that defines a generic way to handle plugins:

  • No pre-load: plugins files are required when needed only

  • Description files support: plugins files can give a description file, enumerating their dependencies, description…

  • Support for plugins categories

  • [If RDI is present]: Try to install dependencies before loading plugin instances

Here are the following symbols that can be used in plugins’ descriptions and are already interpreted by rUtilAnts:

  • Dependencies (list<RDI::Model::DependencyDescription>): List of dependencies this plugin depends on

  • PluginsDependencies (list[String,String]): List of other plugins ([Category,Plugin]) this plugin depends on

  • Enabled (Boolean): Can this plugin be loaded ?

Here are the symbols that are reserved bu rUtilAnts:

  • PluginInstance (Object): The real plugin instance

  • PluginFileName (String): The plugin’s file name (or nil if none)

  • PluginClassName (String): Name of the plugin’s class to instantiate

  • PluginInitCode (Proc): Code to call when instantiating the plugin (or nil if none)

  • PluginIndex (Integer): Unique incremental ID identifying the plugin in its category

  • PluginName (String): Name of the plugin

  • PluginCategoryName (String): Name of the category of the plugin

Defined Under Namespace

Modules: PluginsInterface Classes: DisabledPluginError, FailedPluginError, PluginDependenciesError, PluginDependenciesIgnoredError, PluginDependenciesUnresolvedError, PluginsManager, UnknownCategoryError, UnknownPluginError

Class Method Summary collapse

Class Method Details

.install_plugins_on_objectObject

Initialize a plugins singleton



381
382
383
384
385
# File 'lib/rUtilAnts/Plugins.rb', line 381

def self.install_plugins_on_object
  require 'rUtilAnts/SingletonProxy'
  RUtilAnts::make_singleton_proxy(RUtilAnts::Plugins::PluginsInterface, Object)
  init_plugins
end