1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

15 commits

Author SHA1 Message Date
José Valim
c444b0f67b ADdd missing requires (thanks to @arunagw) 2011-05-07 13:35:21 +02:00
Jason Rudolph
59982acd63 Always flush logger at exit
Prior to this change, running code via script/runner would demonstrate
different logging behavior than running the same code via a rake task.
In production mode the script/runner approach would always flush the
logger, but the rake-based approach would not automatically flush the
logger. This discrepancy violates the principle of least surprise, and
it could lead to the loss of important production logging data.

This change removes special-case code in the "runner" command, and
replaces it with a general solution to ensure that the logger gets
flushed at exit. This solution works for "runner", "console", "server",
rake tasks, and any other process that loads the Rails environment.
2011-05-06 12:21:21 -04:00
John Firebaugh
e683ab7c39 Use AD::Reloader.to_cleanup for reloading [#2873 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-20 12:43:02 +01:00
José Valim
d649bf158b Provide a cleaner syntax for paths configuration that does not rely on method_missing. 2010-10-06 17:20:15 +02:00
Piotr Sarnacki
7cccfed594 Allow Engines loading its own environment file from config/environments 2010-09-03 22:59:04 +02:00
José Valim
312f433241 Clear DescendantsTracker on each request. 2010-06-19 17:51:44 +02:00
José Valim
19d8c8cbe4 Remove the laziness from the middleware stack. 2010-05-29 22:29:46 +02:00
wycats
9cfeefb637 Reorganized initializers a bit to enable better hooks for common cases without the need for Railtie. Specifically, the following hooks were added:
* before_configuration: this hook is run immediately after the Application class 
  comes into existence, but before the user has added any configuration. This is
  the appropriate place to set configuration for your plugin
* before_initialize: This is run after all of the user's configuration has completed,
  but before any initializers have begun (in other words, it runs right after
  config/environments/{development,production,test}.rb)
* after_initialize: This is run after all of the initializers have run. It is an
  appropriate place for forking in a preforking setup

Each of these hooks may be used via ActiveSupport.on_load(name) { }. In all these cases, the context inside the block will be the Application object. This means that for simple cases, you can use these hooks without needing to create a Railtie.
2010-05-15 06:09:07 -07:00
José Valim
1b816d5024 The rake task :environment now loads config/environment.rb instead of initializing the application on its own. This fixes [#4492 state:resolved] and also avoids the application being initialized twice in some rake tasks. 2010-04-29 08:39:52 +02:00
Carlhuda
b01db07a9f Moved initializers for ActionMailer and ActionController into their own railties 2010-03-02 12:32:31 -08:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
José Valim
5d07869245 Ensure all initializers are collections. 2010-01-26 00:08:08 +01:00
José Valim
02908e1142 As first step setup the load path and lazy compare middlewares. 2010-01-25 22:59:08 +01:00
José Valim
b92608770e Ensure environment config has higher priority than application ones. 2010-01-24 12:15:46 +01:00
José Valim
4f03603215 Break application.rb file in smaller chunks. 2010-01-23 16:07:20 +01:00