Module: Takagi::Base::PluginManagement
- Included in:
- Takagi::Base
- Defined in:
- lib/takagi/base/plugin_management.rb
Overview
Provides a simple DSL for declaring and enabling plugins on boot.
Instance Method Summary collapse
Instance Method Details
#enable_plugins!(app: self) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/takagi/base/plugin_management.rb', line 14 def enable_plugins!(app: self) load_config_plugins Takagi::Plugin.auto_discover! if Takagi.config.plugins.auto_discover merged = merged_plugins merged.each do |entry| mod = resolve_plugin(entry[:ref]) info = Takagi::Plugin.register(mod) Takagi::Plugin.enable(info.name, app: app, options: entry[:options]) end end |
#plugin(plugin_ref, order: 0, **options) ⇒ Object
10 11 12 |
# File 'lib/takagi/base/plugin_management.rb', line 10 def plugin(plugin_ref, order: 0, **) plugins_config << { ref: plugin_ref, options: , order: order } end |