With most of the pieces of the puzzle in place, I took today to go back over the codebase and remove artifacts of the refactoring work I've been doing, and spent some time renaming variables and methods I've created so they more accurately reflect what they're doing:
- ActionView::Template had a render method on it in which almost every line was an instance_variable_get or send() into ActionView::Base. I (slowly, very very slowly) moved the method over into ActionView::Base.
- Similarly, I moved the partial rendering code out of ActionView::RenderablePartial and onto ActionView::Base as well.
- I reorganized ActionView, creating directories for "render" and "template", and moving the appropriate files into the directories. This should significantly reduce the amount of visual clutter in the action_view base directory and make it easier to find the part of the code you're looking for.
- I was finally able to remove ActionView::Base#render_for_parts, which was the temporary shim I created when I started this round of refactoring to force all the callers into ActionView to call in with unified parameters. This was replaced with render_for_template yesterday (renamed to render_template_with_layout today), which means that the conduit between parts of ActionPack is now reduced to Template objects and layouts (also Template objects).
- The reorganization I referenced above also moved common methods into common files. For instance, the ActionView methods related to top-level rendering are in render/rendering.rb, while the ones related to rendering partials are in render/partials.rb.
baz * 1000
baz * 1000