Module Webgen::PluginDefs
In: lib/webgen/plugin.rb
RuntimeError PluginParamNotFound PluginNotFound ConfigurationFileInvalid CmdParse::CommandParser CommandParser Test::Unit::TestCase TestCase PluginTestCase DirectoryInfo GalleryStyle WebSiteStyle WebSiteTemplate SipttraStyle TagTestCase CmdParse::Command ShowCommand CheckCommand UseCommand CreateCommand TSort DependencyHash Hash Comparable Language ::Logger Logger Logger DEFAULT_WRAPPER_MODULE WebSite Qt::MainWindow MainWindow Qt::Dialog NewWebsiteDialog Qt::TextEdit LogWidget ::Rake::TaskLib WebgenTask ConfigurationFile Website PluginManager PluginLoader PluginParamValueNotFound Dummy Color CliUtils PluginDefs lib/webgen/languages.rb lib/webgen/website.rb lib/webgen/gui/common.rb lib/webgen/plugin.rb lib/webgen/test.rb lib/webgen/cli.rb ClassMethods PluginDefs LanguageManager lib/webgen/gui/new_website_dlg.rb lib/webgen/gui/main.rb GUI lib/webgen/rake/webgentask.rb Rake Webgen dot/m_60_1.png

Base module for all plugins. This module should be included by classes which need to derive from an existing class but also need the power of the plugin system. If a class does not have any base class, it is better to derive it from Webgen::Plugin instead of including this module.

Methods

[]   append_features   log   new   param  

Classes and Modules

Module Webgen::PluginDefs::ClassMethods

Constants

CALLER_REGEXP = Regexp.new("`.*'")

Public Class methods

Appends the methods of this module as object methods to the including class and the methods defined in the module ClassMethods as class methods.

[Source]

     # File lib/webgen/plugin.rb, line 121
121:     def self.append_features( klass )
122:       super
123:       klass.extend( ClassMethods )
124:     end

Assigns the PluginManager used for the plugin instance.

[Source]

     # File lib/webgen/plugin.rb, line 127
127:     def initialize( plugin_manager )
128:       @plugin_manager = plugin_manager
129:     end

Public Instance methods

Returns the parameter name for the plugin. If plugin is specified, the parameter name for the plugin plugin is returned.

[Source]

     # File lib/webgen/plugin.rb, line 133
133:     def []( name, plugin = nil)
134:       @plugin_manager.param_for_plugin( plugin || self.class.plugin_name, name )
135:     end

Logs the the result of block using the severity level sev_level.

[Source]

     # File lib/webgen/plugin.rb, line 141
141:     def log( sev_level, &block )
142:       source = self.class.plugin_name + '#' + caller[0][CALLER_REGEXP][1..-2]
143:       @plugin_manager.log_msg( sev_level, source, &block )
144:     end
param( name, plugin = nil)

Alias for #[]

[Validate]