crystal deps Package Manager - nob-suz/crystal GitHub Wiki
The command
crystal deps (install|upgrade)
can be used to manage dependencies for your project. The command depends on a Projectfile
defined in the root of your project directory tree. A sample Projectfile
for a web app might look like
deps do
github "manastech/frank", name: "mtfrank"
github "manastech/crystal_redis"
end
This will instruct crystal deps install
to clone the github repo "manastech/crystal" to libs/mtfrank
and "manastech/crystal_redis" to libs/redis
. crystal deps
actively removes crystal[-_] prefixes and [-_]crystal suffixes.
You would then be able to require these libs in your project like:
require "mtfrank/frank"
require "redis"
Path dependencies are also valid. For example:
path "~/working/crystal-oauth"
If a project's name doesn't match the file you need to require (for example, the project's name is "FooBar" and the required file is "foo_bar") you can specify the name to use for the require with name
:
deps do
github "someone/FooBar", name: "foo_bar"
end
Then you require it with that name:
require "foo_bar"