Module: Nesta::Plugin
- Defined in:
- lib/nesta/plugin.rb
Class Attribute Summary collapse
-
.loaded ⇒ Object
Returns the value of attribute loaded.
Class Method Summary collapse
Class Attribute Details
.loaded ⇒ Object
Returns the value of attribute loaded.
4 5 6 |
# File 'lib/nesta/plugin.rb', line 4 def loaded @loaded end |
Class Method Details
.initialize_plugins ⇒ Object
15 16 17 |
# File 'lib/nesta/plugin.rb', line 15 def self.initialize_plugins self.loaded.each { |name| require "#{name}/init" } end |
.register(path) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/nesta/plugin.rb', line 8 def self.register(path) name = File.basename(path, '.rb') prefix = 'nesta-plugin-' name.start_with?(prefix) || raise("Plugin names must match '#{prefix}*'") self.loaded << name end |