Class: Ekylibre::PluginSystem::System

Inherits:
Object
  • Object
show all
Defined in:
lib/ekylibre/plugin_system/system.rb

Overview

This class in the interface between the Rails application and the core plugin system that is basically just the container

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSystem

Returns a new instance of System.



10
11
12
13
# File 'lib/ekylibre/plugin_system/system.rb', line 10

def initialize
  @started = false
  @container = Corindon::DependencyInjection::Container.new
end

Instance Attribute Details

#containerCorindon::DependencyInjection::Container (readonly)

Returns:

  • (Corindon::DependencyInjection::Container)


8
9
10
# File 'lib/ekylibre/plugin_system/system.rb', line 8

def container
  @container
end

Instance Method Details

#pluginsObject



35
36
37
# File 'lib/ekylibre/plugin_system/system.rb', line 35

def plugins
  @container.tagged('ekylibre.system.plugin').map { |key| @container.get(key) }
end

#resetObject



27
28
29
30
31
32
33
# File 'lib/ekylibre/plugin_system/system.rb', line 27

def reset
  if !started?
    start
  else
    container.clear
  end
end

#startObject



15
16
17
18
19
20
# File 'lib/ekylibre/plugin_system/system.rb', line 15

def start
  if !started?
    @started = true
    boot_plugins
  end
end

#started?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/ekylibre/plugin_system/system.rb', line 23

def started?
  @started
end