Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 58 lines (48 sloc) 1.613 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
6690d66 @josevalim Rename config.cookie_secret to config.secret_token and pass it as con…
josevalim authored
6 initializer :add_generator_templates do
7 config.generators.templates.unshift(*paths.lib.templates.to_a)
8 end
9
924fa08 @josevalim First steps into making Plugin < Engine.
josevalim authored
10 initializer :ensure_load_once_paths_as_subset do
11 extra = ActiveSupport::Dependencies.load_once_paths -
12 ActiveSupport::Dependencies.load_paths
13
14 unless extra.empty?
15 abort <<-end_error
16 load_once_paths must be a subset of the load_paths.
17 Extra items in load_once_paths: #{extra * ','}
18 end_error
19 end
20 end
21
d3d4874 @josevalim 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 @josevalim Refactor MetalLoader and RoutesReloader to rely less on class configu…
josevalim authored
28 initializer :add_builtin_route do |app|
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
29 if Rails.env.development?
f38e89c @josh Move railties/builtin into lib
josh authored
30 app.routes_reloader.paths << File.expand_path('../../info_routes.rb', __FILE__)
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
31 end
32 end
33
e49f94d @josevalim Revert behavior from a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59 and ens…
josevalim authored
34 initializer :build_middleware_stack do
35 app
36 end
37
351816f @josevalim Ensure that eager_load actually takes place just after the middleware…
josevalim authored
38 initializer :eager_load! do
39 if config.cache_classes && !$rails_rake_task
3afdfc3 @josevalim Expose remaining hooks to minimize the need for a Railtie based on fe…
josevalim authored
40 ActiveSupport.run_load_hooks(:before_eager_load, self)
351816f @josevalim Ensure that eager_load actually takes place just after the middleware…
josevalim authored
41 railties.all(&:eager_load!)
42 end
43 end
44
45 initializer :finisher_hook do
46 ActiveSupport.run_load_hooks(:after_initialize, self)
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
47 end
48
49 # Disable dependency loading during request cycle
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored
50 initializer :disable_dependency_loading do
51 if config.cache_classes && !config.dependency_loading
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored
52 ActiveSupport::Dependencies.unhook!
53 end
54 end
55 end
56 end
f38e89c @josh Move railties/builtin into lib
josh authored
57 end
Something went wrong with that request. Please try again.