« 25 Days of Ruby Gems - Ruby Advent Calendar 2020, December 1st - December 25th

Day 11 - boring_generators Gem - 10x Development - Speed-Up Your Coding By Automating and Generating Boring Setups

Written by abhaynikam Abhay Nikam

A software developer at AngelList. Working on Ruby on Rails, React and GraphQL. Currently learning TypeScript and React Native. Looking for help with Boring Generators and React Trix Rich Text Editor (RTE).

Problem Statement

Have you ever started a hobby/adventure project and spent half of the initial time in boring configurations and installation of gems and libraries? Yeah. I have been in similar situation. When you start a project you have tons of thought to be processed and ideas that needs attention than working on boring setup and I wanted to counter this problem.

The easiest solution to such problems is to create a simple starter application template bundled with all features you need and use it every time you start a new project. But I see some drawbacks to this solution.

Motivation

I recently wrote a blog on testing rails generators which somewhat speaks about the motivation of working on generators. We use Rails generators all the time. From rails new <app_name> to rails generate model <model_name>. These generators makes using Rails so easy and faster that most of the people are able to concentrate their time on tacking the actual problem the application is supposed to handle. I did some work around Action Text and Action Mailbox generators myself.

Boring generators use the same Rails generator machinery and help you to easily configure the application. We would keep the generators updated as well as you could use the generators mid-way in your projects.

How to use boring generators?

Step 1: Add the gem to your development group:

# Gemfile
gem 'boring_generators', group: :development

Step 2: Run the generator you want from the console:

$ rails generate boring:tailwind:install

NOTE: We are aiming to add a command line tool for boring generators so that you don’t need to add the gem to the Gemfile.

Automate, Automate, Automate

Boring - what can I help you setup or build today? - generators include:

Happy coding!

Find Out More

References

Built with Ruby (running Jekyll) on 2021-03-12 22:04:06 +0000 in 0.371 seconds.
Hosted on GitHub Pages. </> Source on GitHub. (0) Dedicated to the public domain.