This manual explains how to use expm to discover and use packages.
A little bit of necessary theory here.
expm has a very few basic primitives:
- Package, represented by specification defined by Expm.Package record
- Package version: named and specific. Named versions are atoms and specific versions are binaries (Like
:head
and"0.1"
). Package version is part of package specification (Expm.Package.version) - Repository, an entity that implements Expm.Repository protocol. Normally all you need to know is Expm.Repository.HTTP type of repositories. This is what expm uses by default (pointing to http://expm.co repository)
There are two ways to get expm's command line utility:
Go http://expm.co/ and grab it using the download link at the bottom. If you want to do this automatically, use this shell command:
curl -o expm http://expm.co/__download__/expm
After downloading the binary, make it executable:
chmod +x expm
Clone yrashk/expm and type make
. Please note, however,
that for this to work, Elixir (normally the very latest master
at this moment) has to be built and its binaries should be in your PATH
- --repository URL (-r URL)
By default, this is http://expm.co/
- --username USER and --password PASSWORD
Used when publishing a package to the repository
Prints expm's version
Prints repository's expm server's version
Lists all packages in the repository
Searches all packages that match the KEYWORD. KEYWORD can be a partial regular expression.
Prints out topmost PACKAGE's version's specification.
If FIELD is specified, only that field is printed.
Prints out specific PACKAGE's VERSION's specification.
If FIELD is specified, only that field is printed.
Prints a list of PACKAGE's versions
Publishes package to the repository. If the file name is omitted, package.exs
will be used.
Web interface allows you to browse and search packages using your browser. The central repository is available at expm.co
You can retrieve packages in your modules. Here's a brief example:
defmodule MyModule do
use Expm[, url: ...][, repository: ...][,format: Expm.Package.Format.Mix | Expm.Package.Format.Asis]
def my_function do
[
expm("genx"),
expm("esession", version: "0.1")
]
end
end