This is the first post in Enlarge Your Ruby, let’s start with an heavy one. Ruby on Rails gives a structure that helps organize our code. But when the app grows, we drown with hundreds of controllers, models, views. All this stuff is mixed. Tests take forever to run.
Let’s see how to Divide and Conquer with embedded gems and engines.
Stephan Hagemann, working at Pivotal Labs, shared about that during the Rocky Mountain Ruby event, in September 2012:
As Rails applications grow they see a lot of the same problems that any enterprise level software project will see at some point: longer running test suites, more complex code interaction, and a rising requirement to keep “all that stuff” in your head at once.
Rails may have been a framework for single applications in the past, but it nowadays has some features that allow you to tackle bigger projects with more ease. We’ll cover Rails code structuring techniques like unbuilt gems and engines that you can use to get faster test suites, cleaner structures, and more flexible apps.
Video files to download (720p… or only audio) are on Confreaks.
- TheNextBigThing github repository (the example in the conf)
- Migrating from a single Rails app to a suite of Rails engines from Stephan Hagemann too