Once the book is ready in June 2023, you’ll get a handy reference sheet, a series of short practical tips from the book, and a discount.
We’ve all done it…
Duplicate an existing file. Duplicate the corresponding test file.
Open each of those files in your editor, and delete some stuff from each file. Search and replace throughout both files. Manually update a few more things.
Run the tests.
Find some places where the search and replace went bad. Fix those issues.
Run the tests again.
And then get back to the real work.
It’s the copy/paste and search/replace dance.
You might daydream about how great it would be to have it automated, but you’re pretty sure the automation work would take longer than repeatedly trudging through the process manually.
You may have even started to build them once or twice but bailed out because the learning curve felt to steep.
Besides, the copying and pasting and searching and replacing isn’t that painful. Maybe custom generators are only worth it in exceptional situations.
Thankfully that’s not the case if only you can flatten the learning curve.
Building Custom Generators Can be Faster
What if you could quickly build well-tested generators and turn those tedious and repetitive ten-minute distractions into ten-second commands—not just for you but for your entire team?
What if it wasn’t tricky or time-consuming?
How much time could you save yourself and your teammates? How many copy/paste/search/replace tasks could you automate once and for all?
Rails already provides all the tools you need, and with a little curated knowledge of the Rails helpers and some advanced warning about the speed bumps, it can be worth it in far more scenarios than you think.
You can create robust, reliable, and well-tested generator in minutes instead of hours. Countless tedious little tasks turn into solid opportunities for time-saving automation.
Think of it like a tiny superpower. You spend less time muddling through another round of copying, pasting, searching, and replacing so you’re able to focus on high-value, impactful work.
What does it cover?
Frictionless Generators includes a book, reference sheet, and a collection of pre-built generators.
And all of it will be laser-focused on saving you time—including reading and applying them. If the whole point is to save time, you don’t want to spend two weeks reading a book, right?
These topics are likely to evolve slightly, but this should provide a solid overview of what to expect.
- Save Time and Avoid Tedium with Generators
- Ensure Generators are Net Time-savers
- Recognize Optimal Generator Scenarios
- Use Shell Scripts for System Stuff
- Use Rake Tasks for Application Stuff
- Use Generators to Create Source Files
Learn the Foundations
- Thor is the Foundation
- Use Thor Directly for the Simplest Cases
- Draw Inspiration from Built-in Rails Generators
- Documentation-driven Design Helps You Go Faster
- Apply the File Creation Pattern
- Apply the File Updating Pattern
- Use Arguments for Critical Values
- Use Options for Adjusting Behavior
- Minimize Friction with Focused Generators
- The Generator Generator is an Accelerant
- Careful Configuration can Save You
- Let Thor Provide Your Documentation
- Keep Your Templates Boring
- Use `NamedBase` for Internal Generators
- Use `Base` for Simpler Generators
- Leverage Thor Helper Methods for Speed
- Leverage Rails Helper Methods for Convenience
- Start Simple and Enhance Later
Optimizing Arguments and Options
- One Argument and One Collection is Ideal
- Too Many Options Means Trouble
- Specify Defaults and Requirements Judiciously
- Use the Simplest Types Available
- Fewer Options is Usually Faster
- Curate Your Test Configuration
- The `/tmp` Folder is Your Friend
- Testing Generators with RSpec
- Rails Provides All the Test Helpers
- Pre-built Common Scenarios
Tips & Tactics to Level Up
- You can Support Different Workflows
- ActiveRecord Introspection can Help
- Generators can Rely on Other Generators
- You can Extend and Adapt Built-in Generators
Inspiration & Ideas
- Examples of Broadly Useful Generators
- Less-obvious Ideas for Your Own Generators
When will it be released?
The short answer is June 2023. The longer answer is that the The writing is well underway, and I’m aiming for the final version to be released in June 2023, but I should have more to share before that. In the meantime, I’m also writing some blog posts on specific topics related to custom generators, and there’s also an email list where I’ll be sharing compact and focused lessons.
Who is this for?
If you’re a Rails developer who wants to save time on tedious tasks but never quite made it over the initial learning curve creating your own generators, you’ll likely appreciate this book.
If you’re deeply experienced with building custom generators already, it likely won’t cover significant new ground for you, but it may still help surface some opportunities you’ve previously missed out on with custom generators.