diff options
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/bootstrap.rb | 16 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 17 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/application/metal_loader.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/application/routes_reloader.rb | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index b20e53f2de..06243f2e5e 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -1,3 +1,5 @@ +require "active_support/notifications" + module Rails class Application module Bootstrap @@ -49,20 +51,6 @@ module Rails end end - # Initialize rails subscriber on top of notifications. - initializer :initialize_subscriber 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 - initializer :set_clear_dependencies_hook do unless config.cache_classes ActionDispatch::Callbacks.after do diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index d6ad045294..d3a0ecb243 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -5,7 +5,7 @@ module Rails class Configuration < ::Rails::Engine::Configuration include ::Rails::Configuration::Deprecated - attr_accessor :allow_concurrency, :cache_classes, :cache_store, :colorize_logging, + attr_accessor :allow_concurrency, :cache_classes, :cache_store, :consider_all_requests_local, :dependency_loading, :filter_parameters, :log_level, :logger, :metals, :plugins, :preload_frameworks, :reload_engines, :reload_plugins, @@ -14,7 +14,6 @@ module Rails def initialize(*) super @allow_concurrency = false - @colorize_logging = true @filter_parameters = [] @dependency_loading = true @serve_static_assets = true @@ -22,6 +21,10 @@ module Rails @consider_all_requests_local = true end + def middleware + @@default_middleware_stack ||= default_middleware + end + def paths @paths ||= begin paths = super @@ -81,6 +84,16 @@ module Rails def log_level @log_level ||= Rails.env.production? ? :info : :debug end + + def colorize_logging + @colorize_logging + end + + def colorize_logging=(val) + @colorize_logging = val + Rails::LogSubscriber.colorize_logging = val + self.generators.colorize_logging = val + end end end end
\ No newline at end of file diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index b722679ec2..cb38d5a5db 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -31,7 +31,6 @@ module Rails app end - # Fires the user-supplied after_initialize block (config.after_initialize) initializer :after_initialize do config.after_initialize_blocks.each do |block| block.call(self) diff --git a/railties/lib/rails/application/metal_loader.rb b/railties/lib/rails/application/metal_loader.rb index c0f2e4f948..2a43fa7892 100644 --- a/railties/lib/rails/application/metal_loader.rb +++ b/railties/lib/rails/application/metal_loader.rb @@ -34,7 +34,7 @@ module Rails Dir.glob("#{path}/**/*.rb").sort.each do |metal_path| metal = metal_path.sub(matcher, '\1').to_sym next unless list.include?(metal) || list.include?(:all) - require_dependency metal + require_dependency metal.to_s metals << metal end end diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index fde6211c5d..a5154f4bba 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -27,7 +27,7 @@ module Rails routes.clear! paths.each { |path| load(path) } - routes.finalize! + ActionController.base_hook { routes.finalize! } nil ensure |