It's time to quit the copy-paste-search-replace dance.
Duplicate an existing file. Then duplicate the corresponding test file. Open them in your editor. Search and replace throughout both files. Manually update or delete a few more things.

Run the tests. Track down spots the search and replace didn't catch. Fix those issues, and run the tests again. Then you can get back to the real work.
That's no way to do things, and yet, we've all done it far too often.
You already apply and re-use basic patterns on a regular basis. You're just doing it the hard way—either because you didn't know or because you believed custom generators required more effort than they're worth.
Believe it or not, with a little insight, you can effortlessly create well-tested, reliable, and easy-to-use generators that save time—no rocket science involved. And when you create a custom generator, it doesn't just save time for you but for your entire team. Over. And over. And over again.
Every single Rails project already provides all of the tools to build custom generators. With a little guidance, you can use them just as effortlessly as every other part of Rails.

Once you see how custom generators can turn those tedious and repetitive ten-minute distractions into ten-second commands, you'll never look back.
How much time could you save yourself and your teammates?
How many copy/paste/search/replace tasks could you automate once and for all?
This book is an invaluable asset if you’re hoping to dive deeper into saving your team headaches & time, while keeping common development tasks better organized, tested and maintained for the long haul.

What does it cover?
Frictionless Generators takes a holistic approach to help you see how to efficiently create and test custom Rails Generators so you and your team can save time.
The Book

Think of it as a guide for saving time that just happens to use custom Rails Generators as the methodology. We'll cover all of the key API's and tools for creating generators while also avoiding getting stuck in the weeds or creating generators nobody will ever use.
The book provides over 150 pages of pragmatic tips, tactics, and code samples to help you avoid speed bumps and get right into creating your own generators. But it's not just about learning how to create them. It's about learning when to not create one. It's about recognizing when and how to customize an existing generator so you don't reinvent the wheel.

Get two free quick reference sheets and follow along with a short email course to demystify custom generators so you can create them quickly and efficiently. Skip the copy/paste/search/replace dance, and learn how save time with custom Rails generators.
Set aside any pre-conceived notions you may have about creating custom generators in Rails, and you'll add one more powerful tool to that tool belt of yours. And you'll waste less time on the tedious stuff so you can spend it on the high-value work you do.




I learned a lot about a topic that I should know more about because good grief how much time have I spent copying, pasting, and changing Service Object files or spec files.

Chapters & Topics
-
Save Time & Reduce Tedium
- Ensuring Generators are Net Time-savers
- Identifying Generator Opportunities
- Generating More than Code
- Leveraging Tiny Generators
-
Generate the Big Picture
- Understanding Thor's Role
- The Generator Generator is an Accelerant
- Generating Your First Generator
- The Elements & Structure of Generators
- Templates, Sources, and Destinations
- Actions & Inflections
- The Command Line & Documentation
- Arguments, Options, and Interactivity
- Parent Class Options & Inheritance
-
Arguments & Options
- Knowing the Differences and Similarities
- Defining, Passing, and Accessing
- Types & Validation
- Usage, Help, and Documentation
- Judicious Arguments and Options
- Your Generator's First Arguments
-
Usability & Interactivity
- Providing Helpful Documentation
- Communicating Errors & Success
- Collecting Values with Prompts
- Printing Results & Data
- Adding Custom Error Handling
- Making Your Generator Easy to Use
-
Leveraging Templates & Testing
- The Magic & Power of Templates
- Navigating Sources & Destinations
- Writing Clean ERb in Templates
- Using Rails Inflections
- Supercharging Templates with Directories
- JavaScript & Migration Templates
- Automated Testing & Generators
- Efficient Manual Testing
- Dedicated Assertions & Helpers
- Upgrading Your Own Generator
-
Creating & Modifying Files
- Creating without Templates
- Creating/Updating Common Rails Files
- Prepending, Appending, and Inserting Text
- Managing Indentation & Whitespace
- Quoting Strings in ERb
- Commenting/Uncommenting in Ruby Files
- Inline Global Substitutions
- Deleting Files & Directories
-
Utilities & System Commands
- Running System Commands Directly
- Running Ruby Commands Directly
- Safely Navigating Directories
- Version Control with Built-in Git Actions
- Grab Bag of Extra Utilities
-
Extending & Customizing
- Using ActiveRecord Introspection
- Calling Other Generators
- Overriding Generator Templates
- Extending the Built-in Generators
- Hooking Generators Together
-
Quick Reference
- One-page Actions & Configuration Reference
- One-page Values & Inflections Reference
-
Cheat Sheets (Premium Version)
- Generators Cheat Sheet
- Generator Testing Cheat Sheet
- Generator Templates Cheat Sheet
- Generator Command Line Cheat Sheet
-
Example Generators (Premium Version)
- Variety of Ready-to-Use Generators
- Use Directly or as Inspiration
- Learn from Working Code Examples
…reading the book made me realise that I should just make a generator for this simple, repetitive task and save myself (and the team) time in the future.

Quick Reference and “Cheat” Sheets
For any resource to save time, it's not enough to just be a book. Books make for good trail guides, but paging back through a back to look up the name for that one method chips away at your time savings. Books are great, but the tidal wave of new knowledge can be more overwhelming than helpful at times.
That's why Frictionless Generators isn't just a book. It's truly designed to help you save time, and it includes quick reference and cheat sheets for those times when swimming back through the table of contents isn't fast enough.






…I really enjoyed it and learned a couple of things about generators that I didn’t know before. The first part was also a great source of inspiration on the type of generators we could build.


Example Generators
In addition to the standard guidance, Frictionless Generators will also include a collection of pre-built generators for common scenarios. They can serve as well-documented examples and inspiration to learn from, or you can use them directly in your own projects. Use them as is or extend them for your unique needs.
-
Specialized Object Patterns
Quickly create various types of objects for modeling your application's logic with consistent, predictable, and well-tested patterns.
- Value Objects
- Query Objects
- Form Objects
- Policy Objects
- Collection Objects
- Singletons
- Data/Struct
- Presenters
- Decorators
-
Upgraded Rails Generators
Examples of enhancing and modifying the existing generators to safely layer in additional functionality.
- Partials & Helpers
- Generators
- Overriden Templates
-
Scripts & Automation
Leverage generators to spin up skeletons for other types of specialized scripts or automation.
- Shell Scripts
- Bin Scripts
- Rake Tasks
- Rails Commands
- CSV & JSON Reports
-
Documentation & Readme Updates
Streamline the process of spinning up elements of documentation or reports related to the codebase.
- Vendors
- Dependencies
- Reports
- Changelogs
They're all written and documented to be read and easy to follow while also including relevant tests. They cover a wide variety of scenarios to help illustrate how custom generators can be used in a variety of ways for any kind of text files—not just generating code.
I liked it and would recommend it. Your writing style is great, very to-the-point and clear. The book is well organized and had several things I was not aware of being able to do
