Module: Qonfig::Plugins

Defined in:
lib/qonfig/plugins.rb

Overview

Since:

  • 0.4.0

Defined Under Namespace

Modules: AccessMixin Classes: Abstract, PrettyPrint, Registry, TOML, Vault

Class Method Summary collapse

Class Method Details

.load(plugin_name) ⇒ void

This method returns an undefined value.

Parameters:

  • plugin_name (Symbol, String)

Since:

  • 0.4.0



24
25
26
# File 'lib/qonfig/plugins.rb', line 24

def load(plugin_name)
  thread_safe { plugin_registry[plugin_name].load! }
end

.loaded_pluginsArray<String>

Returns:

  • (Array<String>)

Since:

  • 0.19.0



32
33
34
35
36
37
38
39
40
# File 'lib/qonfig/plugins.rb', line 32

def loaded_plugins
  thread_safe do
    plugin_registry.select do |_plugin_name, plugin_module|
      plugin_module.loaded?
    end.map do |plugin_name, _plugin_module|
      plugin_name
    end
  end
end

.namesArray<String>

Returns:

  • (Array<String>)

Since:

  • 0.4.0



46
47
48
# File 'lib/qonfig/plugins.rb', line 46

def names
  thread_safe { plugin_registry.names }
end

.register_plugin(plugin_name, plugin_module) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • plugin_name (Symbol, String)

Since:

  • 0.4.0



55
56
57
# File 'lib/qonfig/plugins.rb', line 55

def register_plugin(plugin_name, plugin_module)
  thread_safe { plugin_registry[plugin_name] = plugin_module }
end