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 |
.load_local_plugins ⇒ Object
19 20 21 22 23 24 |
# File 'lib/nesta/plugin.rb', line 19 def self.load_local_plugins # This approach is deprecated; plugins should now be distributed # as gems. See http://nestacms.com/docs/plugins/writing-plugins plugins = Dir.glob(File.('../plugins/*', File.dirname(__FILE__))) plugins.each { |path| require_local_plugin(path) } 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 |