Class: CouchShell::Plugin
- Inherits:
-
Object
- Object
- CouchShell::Plugin
- Includes:
- PluginUtils
- Defined in:
- lib/couch-shell/plugin.rb
Direct Known Subclasses
CoreDesignsPlugin, CoreEditPlugin, CoreLucenePlugin, CorePlugin, CoreViewsPlugin
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(shell) ⇒ Plugin
constructor
Do not override this method, override plugin_initialization if you need custom initialization logic.
- #plugin_info ⇒ Object
-
#plugin_initialization ⇒ Object
Called by the shell after it instantiates the plugin.
- #plugin_name ⇒ Object
- #shell ⇒ Object
- #variables_object ⇒ Object
Methods included from PluginUtils
#continue?, #dbname!, #editfile!, #edittext!, #ensure_at_database, #request!
Constructor Details
#initialize(shell) ⇒ Plugin
Do not override this method, override plugin_initialization if you need custom initialization logic.
220 221 222 |
# File 'lib/couch-shell/plugin.rb', line 220 def initialize(shell) @_couch_shell_shell = shell end |
Class Method Details
.inherited(klass) ⇒ Object
213 214 215 216 |
# File 'lib/couch-shell/plugin.rb', line 213 def self.inherited(klass) klass.extend PluginClass PluginInfo.register(klass) end |
Instance Method Details
#plugin_info ⇒ Object
228 229 230 |
# File 'lib/couch-shell/plugin.rb', line 228 def plugin_info self.class.plugin_info end |
#plugin_initialization ⇒ Object
Called by the shell after it instantiates the plugin. The shell attribute will be already set.
Override this method if your plugin needs custom initialization logic or to alter the shell behaviour beyond adding variables and commands. The default implementation does nothing.
242 243 |
# File 'lib/couch-shell/plugin.rb', line 242 def plugin_initialization end |
#plugin_name ⇒ Object
232 233 234 |
# File 'lib/couch-shell/plugin.rb', line 232 def plugin_name plugin_info.plugin_name end |
#shell ⇒ Object
224 225 226 |
# File 'lib/couch-shell/plugin.rb', line 224 def shell @_couch_shell_shell end |
#variables_object ⇒ Object
245 246 247 |
# File 'lib/couch-shell/plugin.rb', line 245 def variables_object PluginVariablesObject.new(self) end |