diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-22 20:44:29 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-22 20:44:38 +0100 |
commit | c8cc8a987213bf90fe6922517d52befb7c0587a8 (patch) | |
tree | 55a434ec6ee336f97dc7e9e27c18d9c27d755d62 /railties/lib/rails/bootstrap.rb | |
parent | 4ae79367277954bf6616151b03cbe0660808f9bd (diff) | |
download | rails-c8cc8a987213bf90fe6922517d52befb7c0587a8.tar.gz rails-c8cc8a987213bf90fe6922517d52befb7c0587a8.tar.bz2 rails-c8cc8a987213bf90fe6922517d52befb7c0587a8.zip |
Moved more configuration away from bootstrap.
Diffstat (limited to 'railties/lib/rails/bootstrap.rb')
-rw-r--r-- | railties/lib/rails/bootstrap.rb | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/railties/lib/rails/bootstrap.rb b/railties/lib/rails/bootstrap.rb index 688ab2f4b0..3473f2fcaa 100644 --- a/railties/lib/rails/bootstrap.rb +++ b/railties/lib/rails/bootstrap.rb @@ -33,13 +33,6 @@ module Rails # FIXME This is just a dumb initializer used as hook end - # Create tmp directories - initializer :ensure_tmp_directories_exist do - %w(cache pids sessions sockets).each do |dir_to_make| - FileUtils.mkdir_p(File.join(root, 'tmp', dir_to_make)) - end - end - # Preload all frameworks specified by the Configuration#frameworks. # Used by Passenger to ensure everything's loaded before forking and # to avoid autoload race conditions in JRuby. @@ -64,70 +57,5 @@ module Rails # TODO: Remove files from the $" and always use require ActiveSupport::Dependencies.mechanism = config.cache_classes ? :require : :load end - - # Loads support for "whiny nil" (noisy warnings when methods are invoked - # on +nil+ values) if Configuration#whiny_nils is true. - initializer :initialize_whiny_nils do - require 'active_support/whiny_nil' if config.whiny_nils - end - - # Sets the default value for Time.zone - # If assigned value cannot be matched to a TimeZone, an exception will be raised. - initializer :initialize_time_zone do - require 'active_support/core_ext/time/zones' - zone_default = Time.__send__(:get_zone, config.time_zone) - - unless zone_default - raise \ - 'Value assigned to config.time_zone not recognized.' + - 'Run "rake -D time" for a list of tasks for finding appropriate time zone names.' - end - - Time.zone_default = zone_default - end - - # Set the i18n configuration from config.i18n but special-case for the load_path which should be - # appended to what's already set instead of overwritten. - initializer :initialize_i18n do - require 'active_support/i18n' - - config.i18n.each do |setting, value| - if setting == :load_path - I18n.load_path += value - else - I18n.send("#{setting}=", value) - end - end - - ActionDispatch::Callbacks.to_prepare do - I18n.reload! - end - end - - initializer :set_clear_dependencies_hook do - unless config.cache_classes - ActionDispatch::Callbacks.after do - ActiveSupport::Dependencies.clear - end - end - end - - initializer :initialize_notifications do - require 'active_support/notifications' - - if config.colorize_logging == false - Rails::Subscriber.colorize_logging = false - config.generators.colorize_logging = false - end - - ActiveSupport::Notifications.subscribe do |*args| - Rails::Subscriber.dispatch(args) - end - end - - private - def expand_load_path(load_paths) - load_paths.map { |path| Dir.glob(path.to_s) }.flatten.uniq - end end end |