14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/siba/plugins/plugin_loader.rb', line 14
def load(category, type, options)
unless Siba::Plugins.valid_category? category
raise PluginLoadError, "Incorrect plugin category '#{category}'. Available plugin categories are: #{Siba::Plugins.categories_str}"
end
raise PluginLoadError, "Options data is incorrect for #{plugin_category_and_type} plugin." unless options.is_a? Hash
@category=category
@type=type
@options = options
logger.debug "Loading #{plugin_category_and_type} plugin"
require_plugin
plugin_module = get_plugin_module
plugin_type_module = get_plugin_type_module plugin_module
init_class = get_plugin_init_class plugin_type_module
init_plugin(init_class)
end
|