Module: Radiant::Initializer

Includes:
Rails::Initializer
Defined in:
lib/radiant/initializer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.adminObject



207
208
209
# File 'lib/radiant/initializer.rb', line 207

def self.admin
  AdminUI.instance
end

.configurationObject



211
212
213
# File 'lib/radiant/initializer.rb', line 211

def self.configuration
  Radiant::Configuration
end

Instance Method Details

#add_plugin_load_pathsObject



186
187
188
189
190
191
# File 'lib/radiant/initializer.rb', line 186

def add_plugin_load_paths
  # checks for plugins within extensions:
  extension_loader.add_plugin_paths
  super
  ActiveSupport::Dependencies.load_once_paths -= extension_loader.extension_load_paths
end

#adminObject



221
222
223
# File 'lib/radiant/initializer.rb', line 221

def admin
  configuration.admin
end

#after_initializeObject



201
202
203
204
205
# File 'lib/radiant/initializer.rb', line 201

def after_initialize
  super
  extension_loader.activate_extensions
  configuration.check_extension_dependencies
end

#extension_loaderObject



225
226
227
# File 'lib/radiant/initializer.rb', line 225

def extension_loader
  ExtensionLoader.instance {|l| l.initializer = self }
end

#initialize_i18nObject



179
180
181
182
183
184
# File 'lib/radiant/initializer.rb', line 179

def initialize_i18n
  extension_loader.add_locale_paths
  radiant_locale_paths = Dir[File.join(RADIANT_ROOT, 'config', 'locales', '*.{rb,yml}')]
  configuration.i18n.load_path = radiant_locale_paths + extension_loader.configuration.i18n.load_path
  super
end

#initialize_metalObject

override Rails initializer to insert extension metals



168
169
170
171
172
173
174
175
176
177
# File 'lib/radiant/initializer.rb', line 168

def initialize_metal
  Rails::Rack::Metal.requested_metals = configuration.metals
  Rails::Rack::Metal.metal_paths = ["#{RADIANT_ROOT}/app/metal"] # reset Rails default to RADIANT_ROOT
  Rails::Rack::Metal.metal_paths += plugin_loader.engine_metal_paths
  Rails::Rack::Metal.metal_paths += extension_loader.metal_paths

  configuration.middleware.insert_before(
    :"ActionController::ParamsParser",
    Rails::Rack::Metal, :if => Rails::Rack::Metal.metals.any?)
end

#initialize_routingObject



216
217
218
219
# File 'lib/radiant/initializer.rb', line 216

def initialize_routing
  extension_loader.add_controller_paths
  super
end

#load_pluginsObject



193
194
195
196
197
198
199
# File 'lib/radiant/initializer.rb', line 193

def load_plugins
  super
  extension_loader.load_extensions
  add_gem_load_paths
  load_gems
  check_gem_dependencies
end

#set_autoload_pathsObject



162
163
164
165
# File 'lib/radiant/initializer.rb', line 162

def set_autoload_paths
  extension_loader.add_extension_paths
  super
end