Boyle (IElixir v1.0.1) View Source

This module is responsible for runtime package management. Name of the package honours remarkable chemist, Robert Boyle. This package allows you to manage your Elixir virtual enviromnent without need of restarting erlang virtual machine. Boyle installs environment into ./envs/you_new_environment directory and creates new mix project there with requested dependencies. It keeps takes care of fetching, compiling and loading/unloading modules from dependencies list of that environment.

You can also use this environment as a separate mix project and run it interactively with iex -S mix from the environment directory.

Link to this section Summary

Types

Return values of start* functions

Functions

Activate environment and load all modules that are installed within this module.

Get name of active environment.

Returns a specification to start this module under a supervisor.

Activate environment and unload all modules that are installed within this module.

Get absolute path of active environment.

Show detailed dependencies in the current environment stored in mix.lock file created for the environment.

Callback implementation for GenServer.init/1.

Activate environment and unload all modules that are installed within this module.

List all available environemnts created in the past.

Create new virtual environment where your modules will be stored and compiled.

Print list of modules paths and loaded modules.

Make sure all dependencies are fetched, compiled and loaded.

Remove existing environment.

Get state of Boyle module, some internal paths useful for loaded modules management.

Link to this section Types

Specs

on_start() ::
  {:ok, pid()} | :ignore | {:error, {:already_started, pid()} | term()}

Return values of start* functions

Link to this section Functions

Activate environment and load all modules that are installed within this module.

Examples

iex> Boyle.activate("boyle_test_env")
:ok
iex> Boyle.deactivate()
:ok

Get name of active environment.

Examples

iex> Boyle.activate("boyle_test_env")
:ok
iex> Boyle.active_env_name()
"boyle_test_env"

Returns a specification to start this module under a supervisor.

See Supervisor.

Activate environment and unload all modules that are installed within this module.

Examples

iex> Boyle.activate("boyle_test_env")
:ok
iex> Boyle.deactivate()
:ok

Get absolute path of active environment.

Show detailed dependencies in the current environment stored in mix.lock file created for the environment.

Examples

iex> Boyle.activate("boyle_test_env")
:ok
iex> Boyle.freeze()
{%{decimal:
  {:hex,
    :decimal,
    "1.7.0",
    "30d6b52c88541f9a66637359ddf85016df9eb266170d53105f02e4a67e00c5aa",
    [:mix],
    [],
    "hexpm",
    "771ea78576e5fa505ad58a834f57915c7f5f9df11c87a598a01fdf6065ccfb5d"
  }},
  []}
iex> Boyle.deactivate()
:ok

Callback implementation for GenServer.init/1.

Activate environment and unload all modules that are installed within this module.

Examples

iex> Boyle.activate("boyle_test_env")
:ok
iex> Boyle.install({:decimal, "~> 1.5.0"})
:ok
iex> Boyle.deactivate()
:ok

List all available environemnts created in the past.

Examples

iex> {:ok, envs_list} = Boyle.list() iex> "boyle_test_env" in envs_list true

Create new virtual environment where your modules will be stored and compiled.

Examples

iex> {:ok, envs_list} = Boyle.mk("test_env")
iex> "test_env" in envs_list
true

Print list of modules paths and loaded modules.

Make sure all dependencies are fetched, compiled and loaded.

Remove existing environment.

Examples

iex> {:ok, envs_list} = Boyle.rm("test_env_for_removal")
iex> "test_env_for_removal" in envs_list
false

Specs

start_link(map()) :: on_start()

Get state of Boyle module, some internal paths useful for loaded modules management.