Skip to content
This repository
Browse code

Pull middleware for Rails info from the initializer instead of Action…

…Controller
  • Loading branch information...
commit db65bb5a31dc91f9c74dc310425a42ece489b74e 1 parent 438ff3b
Joshua Peek josh authored
2  railties/builtin/rails_info/rails/info.rb
@@ -114,7 +114,7 @@ def git_info
114 114 end
115 115
116 116 property 'Middleware' do
117   - ActionController::Dispatcher.middleware.active.map {|middle| middle.inspect }
  117 + Rails.configuration.middleware.active.map { |middle| middle.inspect }
118 118 end
119 119
120 120 # The Rails Git revision, if it's checked out into vendor/rails.
4 railties/lib/rails/tasks/middleware.rake
... ... @@ -1,7 +1,7 @@
1 1 desc 'Prints out your Rack middleware stack'
2 2 task :middleware => :environment do
3   - ActionController::Dispatcher.middleware.active.each do |middleware|
  3 + Rails.configuration.middleware.active.each do |middleware|
4 4 puts "use #{middleware.inspect}"
5 5 end
6   - puts "run ActionController::Dispatcher.new"
  6 + puts "run ActionController::Routing::Routes"
7 7 end
8 railties/test/rails_info_test.rb
@@ -80,11 +80,11 @@ def test_frameworks_exist
80 80 end
81 81 end
82 82
83   - def test_middleware_property
84   - assert property_defined?('Middleware')
85   - end
86   -
87 83 def test_html_includes_middleware
  84 + Rails::Info.module_eval do
  85 + property 'Middleware', ['Rack::Lock', 'Rack::Static']
  86 + end
  87 +
88 88 html = Rails::Info.to_html
89 89 assert html.include?('<tr><td class="name">Middleware</td>')
90 90 properties.value_for('Middleware').each do |value|

0 comments on commit db65bb5

Please sign in to comment.
Something went wrong with that request. Please try again.