Module: RSence::Plugins::PluginPlugins

Defined in:
lib/rsence/plugins/plugin_plugins.rb

Overview

Include this module in your subclass of Plugin to enable sub-plugin bundles in another plugin bundle.

The plugins loaded using this system are isolated from system-wide plugins.

To address them from this plugin, use @plugin_plugins instead of @plugins to access them.

Install your sub-plugins into a directory named plugins inside your plugin bundle.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#plugin_pluginsObject (readonly)

Makes @plugin_plugins accessible



26
27
28
# File 'lib/rsence/plugins/plugin_plugins.rb', line 26

def plugin_plugins
  @plugin_plugins
end

Instance Method Details

#cloned_source(msg, target_session) ⇒ Object

Extended #cloned_source, delegates calls to the sub-plugins.



84
85
86
87
# File 'lib/rsence/plugins/plugin_plugins.rb', line 84

def cloned_source( msg, target_session )
  super
  @plugin_plugins.delegate(:cloned_source,msg,target_session)
end

#cloned_target(msg, source_session) ⇒ Object

Extended #cloned_target, delegates calls to the sub-plugins.



78
79
80
81
# File 'lib/rsence/plugins/plugin_plugins.rb', line 78

def cloned_target( msg, source_session )
  super
  @plugin_plugins.delegate(:cloned_target,msg,source_session)
end

#closeObject

Extended #close, delegates calls to the sub-plugins.



47
48
49
50
51
# File 'lib/rsence/plugins/plugin_plugins.rb', line 47

def close
  super
  @plugin_plugins.delegate(:close)
  @plugin_plugins.shutdown
end

#flushObject

Extended #flush, delegates calls to the sub-plugins.



54
55
56
57
# File 'lib/rsence/plugins/plugin_plugins.rb', line 54

def flush
  super
  @plugin_plugins.delegate(:flush)
end

#idle(msg) ⇒ Object

Extended #idle, delegates calls to the sub-plugins.



60
61
62
63
# File 'lib/rsence/plugins/plugin_plugins.rb', line 60

def idle( msg )
  super
  @plugin_plugins.delegate(:idle,msg)
end

#initObject

Extended #init, delegates calls to the sub-plugins.



29
30
31
32
33
34
35
36
37
38
# File 'lib/rsence/plugins/plugin_plugins.rb', line 29

def init
  super
  @plugin_plugins = RSence::PluginManager.new({
    :plugin_paths => [ bundle_path('plugins') ],
    :autoreload => true,
    :name_prefix => name_with_manager_s.to_sym,
    :parent_manager => @plugins,
    :resolved_deps => [ :system, @name, name_with_manager_s.to_sym ]
  })
end

#init_ses(msg) ⇒ Object

Extended #init_ses, delegates calls to the sub-plugins.



66
67
68
69
# File 'lib/rsence/plugins/plugin_plugins.rb', line 66

def init_ses( msg )
  super
  @plugin_plugins.delegate(:init_ses,msg)
end

#openObject

Extended #open, delegates calls to the sub-plugins.



41
42
43
44
# File 'lib/rsence/plugins/plugin_plugins.rb', line 41

def open
  super
  @plugin_plugins.delegate(:open)
end

#restore_ses(msg) ⇒ Object

Extended #restore_ses, delegates calls to the sub-plugins.



72
73
74
75
# File 'lib/rsence/plugins/plugin_plugins.rb', line 72

def restore_ses( msg )
  super
  @plugin_plugins.delegate(:restore_ses,msg)
end