Class: Radiant::ExtensionLoader

Inherits:
Object
  • Object
show all
Includes:
Simpleton
Defined in:
lib/radiant/extension_loader.rb

Defined Under Namespace

Classes: DependenciesObserver

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Simpleton

included

Constructor Details

#initializeExtensionLoader

Returns a new instance of ExtensionLoader.



29
30
# File 'lib/radiant/extension_loader.rb', line 29

def initialize
end

Instance Attribute Details

#extensionsObject

Returns the value of attribute extensions.



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

def extensions
  @extensions
end

#initializerObject

Returns the value of attribute initializer.



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

def initializer
  @initializer
end

Instance Method Details

#activate_extensionsObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/radiant/extension_loader.rb', line 42

def activate_extensions
  # Reset the view paths after

  initialize_default_admin_tabs

  initialize_framework_views

  # Reset the admin UI regions
  admin.load_default_regions

  # Make sure we have our subclasses loaded!
  Page.load_subclasses

  extensions.each do |extension|
    extension.activate if extension.respond_to? :activate
  end
end

#deactivate_extensionsObject



60
61
62
63
64
# File 'lib/radiant/extension_loader.rb', line 60

def deactivate_extensions
  extensions.each do |extension|
    extension.deactivate if extension.respond_to? :deactivate
  end
end

#load_extensionsObject



36
37
38
39
40
# File 'lib/radiant/extension_loader.rb', line 36

def load_extensions
  @observer ||= DependenciesObserver.new.observe(::ActiveSupport::Dependencies)
  core_extensions.each { |extension| load_extension(extension) }
  vendor_extensions.each { |extension| load_extension(extension) }
end