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

Returns a new instance of DependenciesObserver.



16
17
18
19
# 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



26
27
28
29
30
# File 'lib/trusty_cms/extension_loader.rb', line 26

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

#before_clear(*_args) ⇒ Object



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

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