Skip to content
Newer
Older
100644 71 lines (59 sloc) 2.01 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
6690d66 @josevalim Rename config.cookie_secret to config.secret_token and pass it as con…
josevalim authored Apr 5, 2010
6 initializer :add_generator_templates do
d649bf1 @josevalim Provide a cleaner syntax for paths configuration that does not rely o…
josevalim authored Oct 6, 2010
7 config.generators.templates.unshift(*paths["lib/templates"].existent)
6690d66 @josevalim Rename config.cookie_secret to config.secret_token and pass it as con…
josevalim authored Apr 5, 2010
8 end
9
6f83a50 @fxn renames load_(once_)paths to autoload_(once_)paths in dependencies an…
fxn authored Jun 22, 2010
10 initializer :ensure_autoload_once_paths_as_subset do
11 extra = ActiveSupport::Dependencies.autoload_once_paths -
12 ActiveSupport::Dependencies.autoload_paths
924fa08 @josevalim First steps into making Plugin < Engine.
josevalim authored Jan 23, 2010
13
14 unless extra.empty?
15 abort <<-end_error
6f83a50 @fxn renames load_(once_)paths to autoload_(once_)paths in dependencies an…
fxn authored Jun 22, 2010
16 autoload_once_paths must be a subset of the autoload_paths.
17 Extra items in autoload_once_paths: #{extra * ','}
924fa08 @josevalim First steps into making Plugin < Engine.
josevalim authored Jan 23, 2010
18 end_error
19 end
20 end
21
d3d4874 @josevalim Add config.to_prepare back and add tests for it.
josevalim authored Jan 27, 2010
22 initializer :add_to_prepare_blocks do
23 config.to_prepare_blocks.each do |block|
435bccd Replace AD::Callbacks.to_prepare with AD::Reloader.to_prepare
John Firebaugh authored Dec 19, 2010
24 ActionDispatch::Reloader.to_prepare(&block)
d3d4874 @josevalim Add config.to_prepare back and add tests for it.
josevalim authored Jan 27, 2010
25 end
26 end
27
226d8e7 @josevalim Refactor MetalLoader and RoutesReloader to rely less on class configu…
josevalim authored Jan 27, 2010
28 initializer :add_builtin_route do |app|
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
29 if Rails.env.development?
117daba @carllerche Update Rails' built in routes to use RouteSet#append
carllerche authored Sep 17, 2010
30 app.routes.append do
31 match '/rails/info/properties' => "rails/info#properties"
32 end
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
33 end
34 end
35
e49f94d @josevalim Revert behavior from a5684df and ensure after_initializer is executed…
josevalim authored Feb 19, 2010
36 initializer :build_middleware_stack do
f816666 @josevalim Alias app to build_middleware_stack for clarity.
josevalim authored Jun 21, 2010
37 build_middleware_stack
e49f94d @josevalim Revert behavior from a5684df and ensure after_initializer is executed…
josevalim authored Feb 19, 2010
38 end
39
435bccd Replace AD::Callbacks.to_prepare with AD::Reloader.to_prepare
John Firebaugh authored Dec 19, 2010
40 initializer :run_prepare_callbacks do
41 ActionDispatch::Reloader.prepare!
42 end
43
351816f @josevalim Ensure that eager_load actually takes place just after the middleware…
josevalim authored May 15, 2010
44 initializer :eager_load! do
45 if config.cache_classes && !$rails_rake_task
3afdfc3 @josevalim Expose remaining hooks to minimize the need for a Railtie based on fe…
josevalim authored May 16, 2010
46 ActiveSupport.run_load_hooks(:before_eager_load, self)
5a0d73f @josevalim Add lib to load paths when application is inherited to be able to loa…
josevalim authored Jun 2, 2010
47 eager_load!
351816f @josevalim Ensure that eager_load actually takes place just after the middleware…
josevalim authored May 15, 2010
48 end
49 end
50
51 initializer :finisher_hook do
52 ActiveSupport.run_load_hooks(:after_initialize, self)
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
53 end
54
48bf667 @josevalim Ensure routes are loaded only after the initialization process finish…
josevalim authored Sep 2, 2010
55 # Force routes to be loaded just at the end and add it to to_prepare callbacks
56 initializer :set_routes_reloader do |app|
57 reloader = lambda { app.routes_reloader.execute_if_updated }
58 reloader.call
435bccd Replace AD::Callbacks.to_prepare with AD::Reloader.to_prepare
John Firebaugh authored Dec 19, 2010
59 ActionDispatch::Reloader.to_prepare(&reloader)
48bf667 @josevalim Ensure routes are loaded only after the initialization process finish…
josevalim authored Sep 2, 2010
60 end
61
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
62 # Disable dependency loading during request cycle
5d07869 @josevalim Ensure all initializers are collections.
josevalim authored Jan 26, 2010
63 initializer :disable_dependency_loading do
64 if config.cache_classes && !config.dependency_loading
4f03603 @josevalim Break application.rb file in smaller chunks.
josevalim authored Jan 23, 2010
65 ActiveSupport::Dependencies.unhook!
66 end
67 end
68 end
69 end
f38e89c @josh Move railties/builtin into lib
josh authored Mar 20, 2010
70 end
Something went wrong with that request. Please try again.