wand_core v0.2.2 WandCore.WandFile View Source
Module describing the internal state of a wand file, along with helper functions to manipulate the dependencies and serialize the module to disk.
Wand.json
The format for wand.json looks like this:
{ "version": 1.0.0, "dependencies": { "dependency_name': dependency, } }
A dependency can have the following serialized formats in wand.json:
Simple dependency
The value can be a string of the version requirement: "poison": "~> 3.1.0"
.
Dependency with just opts
If, say, pulling from git, the value can be just a map of options: "poison": {"git": "https://github.com/devinus/poison.git"}
Dependency with a version and opts
Lastly, a dependency can be a list of [requirement, opts]
. For example: "poison": ["~> 3.1.0", {"only": ":test"}
Link to this section Summary
Functions
Add a new Dependency to a WandFile, unless the name already exists in the file
Load a wand.json file from disk, and parse it into a WandFile
Remove a dependency to a WandFile by name. Returns the file (always succeeds)
Save the WandFile as a JSON file to the path indicated
Link to this section Types
t() :: %WandCore.WandFile{ dependencies: %{optional(atom()) => WandCore.WandFile.Dependency.t()}, version: String.t() }
Link to this section Functions
add(t(), WandCore.WandFile.Dependency.t()) :: success_or_error()
Add a new Dependency to a WandFile, unless the name already exists in the file
Load a wand.json file from disk, and parse it into a WandFile
remove(t(), WandCore.WandFile.Dependency.name()) :: t()
Remove a dependency to a WandFile by name. Returns the file (always succeeds)
Save the WandFile as a JSON file to the path indicated.