Project

clivers

0.0
No commit activity in last 3 years
No release in over 3 years
This gem has been built to ease usage of multiple versions of command line tools like Ruby, Python, Vagrant, etc. It is not installer, it's a tool to switch between already installed versions of a software. By using a configuration file and some conventions, the tool will be able to locate your program and switch between multiple version of it be tweaking your environment variables, usually simply the PATH one.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

~> 1.1.0
 Project Readme

Clivers

This gem has been built to ease switching multiple versions of command line tools like Ruby, Python, Notepad++, etc. It is not installer, it's a tool to switch already installed software.

By using a configuration file and some conventions, the tool will be able to locate your program and switch between multiple version of the same command line tool by tweaking the environment variables, usually simply the PATH one.

Installation

Install it via rubygems

$ gem install clivers

Usage

The first thing to do is to create a .clivers file in your home directory. This file will contains the information needed to know exactly where to look for programs. This file has a strict format. Here an example of a .clivers file that would be located at ~/.clivers:

python:
  path: "C:/Python"

ruby:
  path: "C:/Ruby"
  executables:
    - "bin/"

vagrant:
  path: "C:/Vagrant"
  executables:
   - "bin/"
  • Important Always use foward slash / when specifying path values, even on Windows.

Now, let see how to interpret this file and also how Clivers interpret it.

The first level is the name of the command line tool to manage. In our case, we have two, python and ruby. The name will be the id of the program and is used, by Clivers in his own cli commands, so choose a short and sweet name.

The second level contains parameters that can be required or optional and will be used by Clivers to setup your environment correctly.

  • Path

    Can be specified with the key path and represents the location where all version of the program is installed. For the path to work correctly, you will need to follow certain conventions when installing the different version of the program. See section Conventions below.

  • Executables

    Can be specified with the key executables and represents the different locations within a program that must be added to the PATH environment. This is an array so multiple executables path can be specified. Only directory are allowed for this parameter.

    When specifying an executable path, you can use ~ as a shortcut for your home directory and . as a shortcut for the program directory. Those shortcuts work even on Windows. See section Conventions to understand where the program directory (.) will resolve to.

    As an example of a usage of executables, take the ruby program specified in the configuration file above. When installing Ruby, the executables are all found in the bin/ directory within the program directory. So specifying the path with bin/ (or ./bin/) will ensure that it will be added to the PATH environment correctly.

Conventions

To be able to work, Clivers will need to follow a specific but loose convention when installing the different command line tool software. The convention is to install all the different versions in different folders all located at the same root where the each folder name represents the version of the software.

Let take an a simple example with Ruby. You want to work with two version of Ruby: 1.8.7 and 1.9.3. Here a possible layout you could have after both installation:

    C:/Ruby
    ├── 1.8.7
        └── bin/
        └── ...
    └── 1.9.3
        └── bin/
        └── ...

Now, with this hierarchy and this config fragment in the .clivers file:

ruby:
  path: "C:/Ruby"
  executables:
    - "bin/"

Clivers will know that version 1.8.7 of Ruby is at location C:/Ruby/1.8.7 and that the bin/ directory within the location must be added to PATH when switching version.

Commands

This section list the various commands that can be executed and their effects on your system.

TBC and more important TBI!

Contributing

  1. Fork it

  2. Create either a fix branch or a feature branch

  • git checkout -b fix-(name-here)
  • git checkout -b feature-(name-here)
  1. Commit your changes
  • git commit -am 'Message describing the fix or feature'
  1. Push the branch into your repo
  • git push origin feature-(name-here)
  1. Create new Pull Request