Scaffolding the project
The first thing we need to do is initialize a new project that'll contain the code for the application. Crystal offers an easy way to do this via the crystal init
command. This command will create a new folder, scaffold out a basic set of files, and initialize an empty Git repository. The command supports creating both app and lib type projects, with the only difference being that lib projects also have the shard.lock
file ignored via .gitignore
, with the reason being the dependencies will be locked via the application using the project. Given we won't have any external shared dependencies and we'll eventually want to allow the project to be included in other Crystal projects, we're going to create a lib project.
Start by running crystal init lib transform
within your terminal. This will initialize a library project called transform
, with the following directory structure (Git-related files omitted for brevity):
. ├─&...