Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (56 sloc) 1.956 kb
4f03603 José Valim Break application.rb file in smaller chunks.
josevalim authored
1 module Rails
2 class Application
3 module Finisher
4 include Initializable
5
6690d66 José Valim Rename config.cookie_secret to config.secret_token and pass it as config...
josevalim authored
6 initializer :add_generator_templates do
7 config.generators.templates.unshift(*paths.lib.templates.to_a)
8 end
9
6f83a50 Xavier Noria renames load_(once_)paths to autoload_(once_)paths in dependencies and c...
fxn authored
10 initializer :ensure_autoload_once_paths_as_subset do
11 extra = ActiveSupport::Dependencies.autoload_once_paths -
12 ActiveSupport::Dependencies.autoload_paths
924fa08 José Valim First steps into making Plugin < Engine.
josevalim authored
13
14 unless extra.empty?
15 abort <<-end_error
6f83a50 Xavier Noria renames load_(once_)paths to autoload_(once_)paths in dependencies and c...
fxn authored
16 autoload_once_paths must be a subset of the autoload_paths.
17 Extra items in autoload_once_paths: #{extra * ','}
924fa08 José Valim First steps into making Plugin < Engine.
josevalim authored
18 end_error
19 end
20 end
21
d3d4874 José Valim Add config.to_prepare back and add tests for it.
josevalim authored
22 initializer :add_to_prepare_blocks do
23 config.to_prepare_blocks.each do |block|
24 ActionDispatch::Callbacks.to_prepare(&block)
25 end
26 end
27
226d8e7 José Valim Refactor MetalLoader and RoutesReloader to rely less on class configurat...
josevalim authored
28 initializer :add_builtin_route do |app|
4f03603 José Valim Break application.rb file in smaller chunks.
josevalim authored
29 if Rails.env.development?
117daba Carl Lerche Update Rails' built in routes to use RouteSet#append
carllerche authored
30 app.routes.append do
31 match '/rails/info/properties' => "rails/info#properties"
32 end
4f03603 José Valim Break application.rb file in smaller chunks.
josevalim authored
33 end
34 end
35
e49f94d José Valim Revert behavior from a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59 and ensure...
josevalim authored
36 initializer :build_middleware_stack do
f816666 José Valim Alias app to build_middleware_stack for clarity.
josevalim authored
37 build_middleware_stack
e49f94d José Valim Revert behavior from a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59 and ensure...
josevalim authored
38 end
39
351816f José Valim Ensure that eager_load actually takes place just after the middleware st...
josevalim authored
40 initializer :eager_load! do
41 if config.cache_classes && !$rails_rake_task
3afdfc3 José Valim Expose remaining hooks to minimize the need for a Railtie based on feedb...
josevalim authored
42 ActiveSupport.run_load_hooks(:before_eager_load, self)
5a0d73f José Valim Add lib to load paths when application is inherited to be able to load l...
josevalim authored
43 eager_load!
351816f José Valim Ensure that eager_load actually takes place just after the middleware st...
josevalim authored
44 end
45 end
46
47 initializer :finisher_hook do
48 ActiveSupport.run_load_hooks(:after_initialize, self)
4f03603 José Valim Break application.rb file in smaller chunks.
josevalim authored
49 end
50
48bf667 José Valim Ensure routes are loaded only after the initialization process finishes,...
josevalim authored
51 # Force routes to be loaded just at the end and add it to to_prepare callbacks
52 initializer :set_routes_reloader do |app|
53 reloader = lambda { app.routes_reloader.execute_if_updated }
54 reloader.call
55 ActionDispatch::Callbacks.to_prepare(&reloader)
56 end
57
4f03603 José Valim Break application.rb file in smaller chunks.
josevalim authored
58 # Disable dependency loading during request cycle
5d07869 José Valim Ensure all initializers are collections.
josevalim authored
59 initializer :disable_dependency_loading do
60 if config.cache_classes && !config.dependency_loading
4f03603 José Valim Break application.rb file in smaller chunks.
josevalim authored
61 ActiveSupport::Dependencies.unhook!
62 end
63 end
64 end
65 end
f38e89c Joshua Peek Move railties/builtin into lib
josh authored
66 end
Something went wrong with that request. Please try again.