lib/plugins/plugin_plugins.rb in rsence-2.0.0.6.pre vs lib/plugins/plugin_plugins.rb in rsence-2.0.0.7.pre
- old
+ new
@@ -5,47 +5,71 @@
# You should have received a copy of the GNU General Public License along
# with this software package. If not, contact licensing@riassence.com
##
module ::RSence
-module Plugins
-## Interface to enable plugins in a plugin. Just include this in your subclass of Plugin.
-module PluginPlugins
- def init
- super
- @plugin_plugins = RSence::PluginManager.new( [ bundle_path('plugins') ] )
+ module Plugins
+
+ # Interface to enable plugins under a plugin.
+ # Just include this in your subclass of Plugin.
+ # The plugins loaded using this system are isolated from other plugins.
+ # To address them from this plugin, use @plugin_plugins instead of
+ # @plugins to address them.
+ module PluginPlugins
+
+ # Extended init, delegates calls to the sub-plugins.
+ def init
+ super
+ @plugin_plugins = RSence::PluginManager.new( [ bundle_path('plugins') ] )
+ end
+
+ # Extended open, delegates calls to the sub-plugins.
+ def open
+ super
+ @plugin_plugins.delegate(:open)
+ end
+
+ # Extended close, delegates calls to the sub-plugins.
+ def close
+ super
+ @plugin_plugins.delegate(:close)
+ end
+
+ # Extended flush, delegates calls to the sub-plugins.
+ def flush
+ super
+ @plugin_plugins.delegate(:flush)
+ end
+
+ # Extended idle, delegates calls to the sub-plugins.
+ def idle( msg )
+ super
+ @plugin_plugins.delegate(:idle,msg)
+ end
+
+ # Extended init_ses, delegates calls to the sub-plugins.
+ def init_ses( msg )
+ super
+ @plugin_plugins.delegate(:init_ses,msg)
+ end
+
+ # Extended restore_ses, delegates calls to the sub-plugins.
+ def restore_ses( msg )
+ super
+ @plugin_plugins.delegate(:restore_ses,msg)
+ end
+
+ # Extended cloned_target, delegates calls to the sub-plugins.
+ def cloned_target( msg, source_session )
+ super
+ @plugin_plugins.delegate(:cloned_target,msg,source_session)
+ end
+
+ # Extended cloned_source, delegates calls to the sub-plugins.
+ def cloned_source( msg, target_session )
+ super
+ @plugin_plugins.delegate(:cloned_source,msg,target_session)
+ end
+
+ end
end
- def open
- super
- @plugin_plugins.delegate(:open)
- end
- def close
- super
- @plugin_plugins.delegate(:close)
- end
- def flush
- super
- @plugin_plugins.delegate(:flush)
- end
- def idle( msg )
- super
- @plugin_plugins.delegate(:idle,msg)
- end
- def init_ses( msg )
- super
- @plugin_plugins.delegate(:init_ses,msg)
- end
- def restore_ses( msg )
- super
- @plugin_plugins.delegate(:restore_ses,msg)
- end
- def cloned_target( msg, source_session )
- super
- @plugin_plugins.delegate(:cloned_target,msg,source_session)
- end
- def cloned_source( msg, target_session )
- super
- @plugin_plugins.delegate(:cloned_source,msg,target_session)
- end
-end
-end
end