Skip to content

Commit

Permalink
Pull middleware for Rails info from the initializer instead of Action…
Browse files Browse the repository at this point in the history
…Controller
  • Loading branch information
josh committed Sep 26, 2009
1 parent 438ff3b commit db65bb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion railties/builtin/rails_info/rails/info.rb
Expand Up @@ -114,7 +114,7 @@ def git_info
end

property 'Middleware' do
ActionController::Dispatcher.middleware.active.map {|middle| middle.inspect }
Rails.configuration.middleware.active.map { |middle| middle.inspect }
end

# The Rails Git revision, if it's checked out into vendor/rails.
Expand Down
4 changes: 2 additions & 2 deletions railties/lib/rails/tasks/middleware.rake
@@ -1,7 +1,7 @@
desc 'Prints out your Rack middleware stack'
task :middleware => :environment do
ActionController::Dispatcher.middleware.active.each do |middleware|
Rails.configuration.middleware.active.each do |middleware|
puts "use #{middleware.inspect}"
end
puts "run ActionController::Dispatcher.new"
puts "run ActionController::Routing::Routes"
end
8 changes: 4 additions & 4 deletions railties/test/rails_info_test.rb
Expand Up @@ -80,11 +80,11 @@ def test_frameworks_exist
end
end

def test_middleware_property
assert property_defined?('Middleware')
end

def test_html_includes_middleware
Rails::Info.module_eval do
property 'Middleware', ['Rack::Lock', 'Rack::Static']
end

html = Rails::Info.to_html
assert html.include?('<tr><td class="name">Middleware</td>')
properties.value_for('Middleware').each do |value|
Expand Down

0 comments on commit db65bb5

Please sign in to comment.