Class: TrustyCms::ExtensionLoader::DependenciesObserver

Inherits:
MethodObserver
  • Object
show all
Defined in:
lib/trusty_cms/extension_loader.rb

Overview

The ExtensionLoader is reponsible for the loading, activation and reactivation of extensions. The noticing of important subdirectories is now handled by the ExtensionPath class.

Instance Attribute Summary collapse

Attributes inherited from MethodObserver

#result, #target

Instance Method Summary collapse

Methods inherited from MethodObserver

instances, new, #observe

Constructor Details

#initialize(rails_config) ⇒ DependenciesObserver

:nodoc



16
17
18
# File 'lib/trusty_cms/extension_loader.rb', line 16

def initialize(rails_config) #:nodoc
  @config = rails_config
end

Instance Attribute Details

#configObject

Extends the reload mechanism in ActiveSupport so that extensions are deactivated and reactivated when model classes are reloaded (in development mode, usually).



14
15
16
# File 'lib/trusty_cms/extension_loader.rb', line 14

def config
  @config
end

Instance Method Details

#after_clear(*_args) ⇒ Object

:nodoc



24
25
26
27
# File 'lib/trusty_cms/extension_loader.rb', line 24

def after_clear(*_args) #:nodoc
  ExtensionLoader.load_extensions
  ExtensionLoader.activate_extensions
end

#before_clear(*_args) ⇒ Object

:nodoc



20
21
22
# File 'lib/trusty_cms/extension_loader.rb', line 20

def before_clear(*_args) #:nodoc
  ExtensionLoader.deactivate_extensions
end