Creating generators and executables with Thor

1 · Nando Vieira · July 14, 2015, 2:16 a.m.
Thor is an amazing library for creating generators. It gives you methods for creating and copying files and directories, defining symbolic links, read remote files, and more. And is the perfect companion for gems that need to generate a project structure, just like Rails. The first thing you need is defining the generator class. require 'thor' require 'thor/group' class MyGem::Generator < Thor::Group include Thor::Actions desc 'Generate a new filesystem structure' end The Thor::Group class...