envirius
— universal virtual environments manager.
Usually this kind of tools narrowly specialized for a particular programming language. For example:
- virtualenv for python
- rvm for ruby
- kerl for erlang
- nvm/nodeenv for node.js
- and so on
But there are many cases when in one and the same environment you must have more
than one programming language. For example, to create an environment with
python2.6
and node.js 0.10.24
. This idea underlies envirius
.
Support for new programming languages are implemented as plug-ins.
At first:
$ git clone git@github.com:ekalinin/envirius.git
$ cd envirius
$ make install
Then youd need to add into your .bashrc
the following:
# activate envirius itself
# (mandatory part)
if [ -e "~/.envirius/nv" ] ; then
. ~/.envirius/nv
fi
# auto environment activation
# when navigate to folder with '.envirius' file
# (optional part)
if [ -e ".envirius" ] ; then
nv on `cat .envirius` --prompt-enable
fi
You can create environments for the following programming languages at the moment:
To check available plugins:
➥ nv plugins
elixir
erlang
julia
node
rust
To check available versions for each plugin:
➥ nv versions --rust --erlang
* rust:
0.1 0.2 0.3 0.4 0.5
0.6 0.7 0.8 0.9
* erlang:
R10B-0 R10B-10 R10B-1a R10B-2 R10B-3 R10B-4
R10B-5 R10B-6 R10B-7 R10B-8 R10B-9 R11B-0
R11B-1 R11B-2 R11B-3 R11B-4 R11B-5 R12B-0
R12B-1 R12B-2 R12B-3 R12B-4 R12B-5 R13A
R13B R13B01 R13B02-1 R13B02 R13B03 R13B04
R14A R14B R14B01 R14B02 R14B03 R14B04
R15B R15B01 R15B02 R15B02 R15B03-1 R15B03
R16A R16B R16B01 R16B02 R16B03-1 R16B03
17.0-rc1
To create an environment:
➥ nv mk mixed-rust-erlang --rust=0.9 --erlang=17.0-rc1
Creating environment: mixed-rust-erlang ...
* installing rust==0.9 ...
* done (in 5 secs.)
* installing erlang==17.0-rc1 ...
* done (in 11 secs.)
Get list of the environments:
➥ nv ls
Available environment(s):
mixed-rust-erlang
rust-0.9
erl-17-rc1
To activate environment:
➥ mem on mixed-rust-erlang --prompt-enable
Environment mixed-rust-erlang activated.
To check if environment activated:
(mixed-rust-erlang) ➥ nv current
mixed-rust-erlang
To deactivate environment:
(mixed-rust-erlang) ➥ nv off
Environment mixed-rust-erlang was deactivated.
All plugins are in the directory nv-plugins
. If you need a new one
you should add it inside this directory.
In the simplest case you need to implement 2 functions in the plugin's body:
plug_list_versions
which returns list of available versions of the pluginplug_url_for_download
which returns full url for downloading tarball
If installation is not typical then you should implement plug_install
instead of plug_url_for_download
. Default implementation of the
plug_install
function is in the src/nv-commands/mk
file.
plug_list_versions_columns_count
plug_list_versions_columns_size
plug_state
if ==disabled
then plugin is not active and will not be account in the commands:- mk
- versions
- plugins
- bash
- curl / wget
- tar
- git
- gcc
- bats
- ubuntu
Most of the code is covered by tests. For testing bats was used. To run tests:
➥ make tests
...
22 tests, 0 failures
See CHANGELOG.md.
See LICENSE.