nima / site

Modular shell-scripting framework - 99% native bash, 1% phat!
http://nima.github.io/site/
5 stars 4 forks source link

Settle on *env (rbenv, pyenv, and plenv) as standard for xplm #29

Open nima opened 10 years ago

nima commented 10 years ago

After some research in module management of Ruby, Python, and Perl; it appears that a decent way forward is to use the *env virtual environments, rbenv has already been implemented and works well, so now we can switch from virtualenv (which doesn't manage Python's version itself), and also fill in the blank for Perl (no current implementation in xplm). For completeness, here are the three:

nima commented 10 years ago

Done! I will leave this issue open until unit-testing is complete and active however.

Here's a quick usage example; note that the first of the two commands in each of the 3 groups below only need to be run once.

#. Install ruby, and then a ruby module (via gem, into ~/.site/var/rbenv)
$ site xplm rb install
$ site xplm rb install puppet

#. Install python, and then a python module (via pip, into ~/.site/var/pyenv)
$ site xplm py install
$ site xplm py install paramiko

#. Install perl, and then a perl module (via cpanm, into ~/.site/var/plenv)
$ site xplm pl install
$ site xplm pl install Net::SNMP

All installations are now sandboxed with site, and no longer dependant on os packages, so scripts written will be portable.

nima commented 10 years ago

Implemented 3 wrapper modules, pl, py, and rb. These are effectively dumb abstracting modules that wrap and interface xplm, purely to ease user experience and reduce confusion. The blurb above would now look like this:

#. Install ruby, and then a ruby module (via gem, into ~/.site/var/rbenv)
$ site rb install
$ site rb install puppet

#. Install python, and then a python module (via pip, into ~/.site/var/pyenv)
$ site py install
$ site py install paramiko

#. Install perl, and then a perl module (via cpanm, into ~/.site/var/plenv)
$ site pl install
$ site pl install Net::SNMP