Skip to content
Newer
Older
100644 49 lines (42 sloc) 1.35 KB
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
1 module Rails
2 class Application
3 module Finisher
4 include Initializable
5
924fa08 @josevalim First steps into making Plugin < Engine.
josevalim authored Jan 23, 2010
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
d3d4874 @josevalim Add config.to_prepare back and add tests for it.
josevalim authored Jan 27, 2010
18 initializer :add_to_prepare_blocks do
19 config.to_prepare_blocks.each do |block|
20 ActionDispatch::Callbacks.to_prepare(&block)
21 end
22 end
23
226d8e7 @josevalim Refactor MetalLoader and RoutesReloader to rely less on class configu…
josevalim authored Jan 27, 2010
24 initializer :add_builtin_route do |app|
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
25 if Rails.env.development?
226d8e7 @josevalim Refactor MetalLoader and RoutesReloader to rely less on class configu…
josevalim authored Jan 27, 2010
26 app.routes_reloader.paths << File.join(RAILTIES_PATH, 'builtin', 'routes.rb')
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
27 end
28 end
29
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored Jan 26, 2010
30 initializer :build_middleware_stack do
31 app
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
32 end
33
d3d4874 @josevalim Add config.to_prepare back and add tests for it.
josevalim authored Jan 27, 2010
34 # Fires the user-supplied after_initialize block (config.after_initialize)
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored Jan 25, 2010
35 initializer :after_initialize do
36 config.after_initialize_blocks.each do |block|
37 block.call(self)
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
38 end
39 end
40
41 # Disable dependency loading during request cycle
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored Jan 25, 2010
42 initializer :disable_dependency_loading do
43 if config.cache_classes && !config.dependency_loading
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
44 ActiveSupport::Dependencies.unhook!
45 end
46 end
47 end
48 end
49 end
Something went wrong with that request. Please try again.