Skip to content
Newer
Older
100644 43 lines (37 sloc) 1.19 KB
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
1 module Rails
2 class Application
3 module Finisher
4 include Initializable
5
924fa08 @josevalim First steps into making Plugin < Engine.
josevalim authored
6 initializer :ensure_load_once_paths_as_subset do
7 extra = ActiveSupport::Dependencies.load_once_paths -
8 ActiveSupport::Dependencies.load_paths
9
10 unless extra.empty?
11 abort <<-end_error
12 load_once_paths must be a subset of the load_paths.
13 Extra items in load_once_paths: #{extra * ','}
14 end_error
15 end
16 end
17
226d8e7 @josevalim Refactor MetalLoader and RoutesReloader to rely less on class configu…
josevalim authored
18 initializer :add_builtin_route do |app|
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
19 if Rails.env.development?
226d8e7 @josevalim Refactor MetalLoader and RoutesReloader to rely less on class configu…
josevalim authored
20 app.routes_reloader.paths << File.join(RAILTIES_PATH, 'builtin', 'routes.rb')
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
21 end
22 end
23
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored
24 initializer :build_middleware_stack do
25 app
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
26 end
27
28 # Fires the user-supplied after_initialize block (config#after_initialize)
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored
29 initializer :after_initialize do
30 config.after_initialize_blocks.each do |block|
31 block.call(self)
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
32 end
33 end
34
35 # Disable dependency loading during request cycle
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored
36 initializer :disable_dependency_loading do
37 if config.cache_classes && !config.dependency_loading
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
38 ActiveSupport::Dependencies.unhook!
39 end
40 end
41 end
42 end
43 end
Something went wrong with that request. Please try again.