Another attempt to try to cleanup MiniProfiler. I started trying to group similar logic together to pull out to its own module, and the ones that stood out had to do with serving an HTTP response directly (ie actions) and generating HTML for said response.
That lead me to introducing Actions and HTML modules. This is just grouping methods into logical modules and including them, so it really change much functionally. It does let you see similar methods a lot closer together.
For Actions, most of the methods were already named serve_, so I moved those to Actions. Anything else that was serving up a request directly was moved there and named as well.
I changed serve_html a little because despite the name, it does serve up other things. I hoisted those conditionals for snapshot, results, and flamegraphs out of the method to the one place where serve_html was called.
Another attempt to try to cleanup MiniProfiler. I started trying to group similar logic together to pull out to its own module, and the ones that stood out had to do with serving an HTTP response directly (ie actions) and generating HTML for said response.
That lead me to introducing
Actions
andHTML
modules. This is just grouping methods into logical modules and including them, so it really change much functionally. It does let you see similar methods a lot closer together.For
Actions
, most of the methods were already namedserve_
, so I moved those to Actions. Anything else that was serving up a request directly was moved there and named as well.I changed
serve_html
a little because despite the name, it does serve up other things. I hoisted those conditionals for snapshot, results, and flamegraphs out of the method to the one place where serve_html was called.