January 2019
Intermediate to advanced
246 pages
5h 23m
English
When building your app, you don’t want to reinvent the wheel. More often than not, parts of your functionality are already covered by existing Crystal packages or libraries. Commonly called shards, they’re the equivalent of gems in the Ruby world.
shards is also the name of the application that manages the dependencies of a project, like bundler in Ruby. How can you instruct your app to load one or more external shards?
Your app can list its dependencies in the file shard.yml (for Rubyists: the gemfile), which we’ll take a closer look at now. At the start of a project, it looks like this:
| | name: mineral |
| | version: 0.1.0 |
| | |
| | authors: |
| | - Your-Name <your-email-address> |
| | |
| | targets: |
| | mineral: |
| | main: src/mineral. ... |
Read now
Unlock full access