简体   繁体   中英

How to examine default Rack middleware in Rails application

I'm trying to get a better handle on Rack middleware, and I've just learned that you can view all of the installed middlewares for a Rails app using rails middleware . In a fresh Rails app, that's about 25 different middlewares.

I'd really like to examine the source code of these different middlewares, but I can't find out where they live in the app. Have they all been compiled to executable, so the only way I can read the source is on Github? If so, how can I find those repos? Thanks!

For the ActionDispatch, ActiveRecord, Rails, ActiveSupport, and Testing middlewares, they'll be in rails/rails , the Rack stuff will be in rack/rack , and WebConsole will be in rails/web-console

They're not compiled into an executable, no. Each gem is downloaded based on the contents of your Gemfile and gets semi-magically loaded via your environment and config.ru.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM