Permalink
Browse files

Checkpoint. Added a bunch of TODOs and some changes after further goi…

…ng through the initializer
  • Loading branch information...
1 parent b5dfdc7 commit 2865421f5d77170c1ff39013d9d4efbc98526e74 Yehuda Katz + Carl Lerche committed Jun 25, 2009
Showing with 8 additions and 15 deletions.
  1. +8 −15 railties/lib/initializer.rb
@@ -179,6 +179,10 @@ def self.run(initializer = nil, config = nil)
begin
require 'active_support'
require 'active_support/core_ext/kernel/reporting'
+ require 'active_support/core_ext/logger'
+
+ # TODO: This is here to make Sam Ruby's tests pass. Needs discussion.
+ require 'active_support/core_ext/numeric/bytes'
configuration.frameworks.each { |framework| require(framework.to_s) }
rescue LoadError => e
# Re-raise as RuntimeError because Mongrel would swallow LoadError.
@@ -307,6 +311,7 @@ def self.run(initializer = nil, config = nil)
end
end
+ # TODO: Why are we silencing warning here?
silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger }
end
@@ -326,6 +331,7 @@ def self.run(initializer = nil, config = nil)
# Sets the dependency loading mechanism based on the value of
# Configuration#cache_classes.
Initializer.default.add :initialize_dependency_mechanism do
+ # TODO: Remove files from the $" and always use require
ActiveSupport::Dependencies.mechanism = configuration.cache_classes ? :require : :load
end
@@ -409,10 +415,6 @@ def self.run(initializer = nil, config = nil)
end
end
- # Add the load paths used by support functions such as the info controller
- Initializer.default.add :add_support_load_paths do
- end
-
Initializer.default.add :check_for_unbuilt_gems do
unbuilt_gems = config.gems.select {|gem| gem.frozen? && !gem.built? }
if unbuilt_gems.size > 0
@@ -462,6 +464,7 @@ def self.run(initializer = nil, config = nil)
# # pick up any gems that plugins depend on
Initializer.default.add :add_gem_load_paths do
require 'rails/gem_dependency'
+ # TODO: This seems extraneous
Rails::GemDependency.add_frozen_gem_path
unless config.gems.empty?
require "rubygems"
@@ -529,6 +532,7 @@ def self.run(initializer = nil, config = nil)
end
end
+ # TODO: Make a DSL way to limit an initializer to a particular framework
# # Prepare dispatcher callbacks and run 'prepare' callbacks
Initializer.default.add :prepare_dispatcher do
@@ -557,17 +561,6 @@ def self.run(initializer = nil, config = nil)
end
end
- # # Load view path cache
- Initializer.default.add :load_view_paths do
- if configuration.frameworks.include?(:action_view)
- if configuration.cache_classes
- view_path = ActionView::FileSystemResolverWithFallback.new(configuration.view_path)
- ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller)
- ActionMailer::Base.template_root = view_path if configuration.frameworks.include?(:action_mailer)
- end
- end
- end
-
# Eager load application classes
Initializer.default.add :load_application_classes do
next if $rails_rake_task

0 comments on commit 2865421

Please sign in to comment.