diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/initializer.rb | 5 | ||||
-rw-r--r-- | railties/lib/tasks/middleware.rake | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index a134c68a50..4bb1e480b7 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -881,6 +881,11 @@ Run `rake gems:install` to install the missing gems. end end + def middleware + require 'action_controller' + ActionController::Dispatcher.middleware + end + def builtin_directories # Include builtins only in the development environment. (environment == 'development') ? Dir["#{RAILTIES_PATH}/builtin/*/"] : [] diff --git a/railties/lib/tasks/middleware.rake b/railties/lib/tasks/middleware.rake new file mode 100644 index 0000000000..e0dcf50307 --- /dev/null +++ b/railties/lib/tasks/middleware.rake @@ -0,0 +1,7 @@ +desc 'Prints out your Rack middleware stack' +task :middleware => :environment do + ActionController::Dispatcher.middleware.each do |middleware| + puts "use #{middleware.inspect}" + end + puts "run ActionController::Dispatcher.new" +end |