clivers 1.0.0.dev1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.buildpath +5 -0
- data/.project +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +155 -0
- data/Rakefile +1 -0
- data/clivers.gemspec +36 -0
- data/lib/clivers/version.rb +3 -0
- data/lib/clivers.rb +2 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NDY2ZTVlYzcyNDdiNDQzYTdkODQ0MGMwOWEyNzEzMTljNGU5MDFlYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTJkOGQ1Y2JlMDc2ZDI3NzhjNGM1NGNlMjAwZGFhNjY5ZmMxNDI1Nw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MmJhYzVhNWNkYzc2NjlmMDdjNTU4NDEzZDBmNmM4YmE1NjY3ZDUzMDZmNTQ3
|
10
|
+
MTBjOTdjNmVmMDA0MTAwMTM4OWI3ZjVlN2FmMmUzZWE1NWUyMzJiYjRjYzI2
|
11
|
+
YmNiOTI2MjYzZmY3MmEzMWZjYmE2NjFkZGQ0NDE2NzgxZGQ0MjA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODk1ZGM5YzQ4NjE2M2Y2ZGYyMGJjYjdiZmIyZDc1NGQyZTU1YmM5YjM5NGM1
|
14
|
+
YTJlM2M5MWI2M2M2YWNlNmIyN2Q5NTJmMjFkMTVhYzdiMDJkYzJhYzA0MWZh
|
15
|
+
ODkzMTVhMmRhNWYxMzBjNGI1YWYwMTc2Mzk5MzVmNDc4NTRlYjY=
|
data/.buildpath
ADDED
data/.project
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>clivers</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
<buildCommand>
|
9
|
+
<name>org.eclipse.dltk.core.scriptbuilder</name>
|
10
|
+
<arguments>
|
11
|
+
</arguments>
|
12
|
+
</buildCommand>
|
13
|
+
</buildSpec>
|
14
|
+
<natures>
|
15
|
+
<nature>org.eclipse.dltk.ruby.core.nature</nature>
|
16
|
+
</natures>
|
17
|
+
</projectDescription>
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Matthieu Vachon
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
# Clivers
|
2
|
+
|
3
|
+
This gem has been built to ease switching multiple versions
|
4
|
+
of command line tools like Ruby, Python, Notepad++, etc. It
|
5
|
+
is not installer, it's a tool to switch already installed
|
6
|
+
software.
|
7
|
+
|
8
|
+
By using a configuration file and some conventions, the
|
9
|
+
tool will be able to locate your program and switch
|
10
|
+
between multiple version of the same command line tool by
|
11
|
+
tweaking the environment variables, usually simply the
|
12
|
+
PATH one.
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Install it via [rubygems](https://rubygems.org/gems/clivers)
|
17
|
+
|
18
|
+
$ gem install clivers
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
The first thing to do is to create a `.clivers` file in your home
|
23
|
+
directory. This file will contains the information needed
|
24
|
+
to know exactly where to look for programs. This file
|
25
|
+
has a strict format. Here an example of a `.clivers` file
|
26
|
+
that would be located at `~/.clivers`:
|
27
|
+
|
28
|
+
```yaml
|
29
|
+
python:
|
30
|
+
path: "C:/Python"
|
31
|
+
|
32
|
+
ruby:
|
33
|
+
path: "C:/Ruby"
|
34
|
+
executables:
|
35
|
+
- "bin/"
|
36
|
+
|
37
|
+
vagrant:
|
38
|
+
path: "C:/Vagrant"
|
39
|
+
executables:
|
40
|
+
- "bin/"
|
41
|
+
```
|
42
|
+
|
43
|
+
* **Important**
|
44
|
+
Always use foward slash `/` when specifying
|
45
|
+
path values, even on Windows.
|
46
|
+
|
47
|
+
Now, let see how to interpret this file and also how
|
48
|
+
Clivers interpret it.
|
49
|
+
|
50
|
+
The first level is the name of the command line tool to
|
51
|
+
manage. In our case, we have two, `python` and `ruby`.
|
52
|
+
The name will be the id of the program and is used,
|
53
|
+
by Clivers in his own cli commands, so choose a short
|
54
|
+
and sweet name.
|
55
|
+
|
56
|
+
The second level contains parameters that can be required
|
57
|
+
or optional and will be used by Clivers to setup your
|
58
|
+
environment correctly.
|
59
|
+
|
60
|
+
* **Path**
|
61
|
+
|
62
|
+
Can be specified with the key `path` and represents
|
63
|
+
the location where all version of the program is
|
64
|
+
installed. For the path to work correctly, you will
|
65
|
+
need to follow certain conventions when installing
|
66
|
+
the different version of the program. See section
|
67
|
+
[Conventions](https://github.com/maoueh/clivers#conventions)
|
68
|
+
below.
|
69
|
+
|
70
|
+
* **Executables**
|
71
|
+
|
72
|
+
Can be specified with the key `executables` and
|
73
|
+
represents the different locations within a program
|
74
|
+
that must be added to the PATH environment. This is
|
75
|
+
an array so multiple executables path can be
|
76
|
+
specified. Only directory are allowed for this
|
77
|
+
parameter.
|
78
|
+
|
79
|
+
When specifying an executable path, you can use `~` as
|
80
|
+
a shortcut for your home directory and `.` as a
|
81
|
+
shortcut for the program directory. Those shortcuts
|
82
|
+
work even on Windows. See section
|
83
|
+
[Conventions](https://github.com/maoueh/clivers#conventions)
|
84
|
+
to understand where the program directory (`.`) will
|
85
|
+
resolve to.
|
86
|
+
|
87
|
+
As an example of a usage of `executables`, take the
|
88
|
+
`ruby` program specified in the configuration file
|
89
|
+
above. When installing Ruby, the executables are all
|
90
|
+
found in the `bin/` directory within the program
|
91
|
+
directory. So specifying the path with `bin/` (or
|
92
|
+
`./bin/`) will ensure that it will be added to the
|
93
|
+
PATH environment correctly.
|
94
|
+
|
95
|
+
### Conventions
|
96
|
+
|
97
|
+
To be able to work, Clivers will need to follow a
|
98
|
+
specific but loose convention when installing the
|
99
|
+
different command line tool software. The convention
|
100
|
+
is to install all the different versions in different
|
101
|
+
folders all located at the same root where the each
|
102
|
+
folder name represents the version of the software.
|
103
|
+
|
104
|
+
Let take an a simple example with `Ruby`. You want
|
105
|
+
to work with two version of `Ruby`: `1.8.7` and
|
106
|
+
`1.9.3`. Here a possible layout you could have after
|
107
|
+
both installation:
|
108
|
+
|
109
|
+
```
|
110
|
+
C:/Ruby
|
111
|
+
├── 1.8.7
|
112
|
+
└── bin/
|
113
|
+
└── ...
|
114
|
+
└── 1.9.3
|
115
|
+
└── bin/
|
116
|
+
└── ...
|
117
|
+
```
|
118
|
+
|
119
|
+
Now, with this hierarchy and this config fragment in the
|
120
|
+
`.clivers` file:
|
121
|
+
|
122
|
+
```yaml
|
123
|
+
ruby:
|
124
|
+
path: "C:/Ruby"
|
125
|
+
executables:
|
126
|
+
- "bin/"
|
127
|
+
```
|
128
|
+
|
129
|
+
Clivers will know that version `1.8.7` of Ruby is at
|
130
|
+
location `C:/Ruby/1.8.7` and that the `bin/` directory
|
131
|
+
within the location must be added to PATH when switching
|
132
|
+
version.
|
133
|
+
|
134
|
+
### Commands
|
135
|
+
|
136
|
+
This section list the various commands that can be executed
|
137
|
+
and their effects on your system.
|
138
|
+
|
139
|
+
TBC and more important TBI!
|
140
|
+
|
141
|
+
## Contributing
|
142
|
+
|
143
|
+
1. Fork it
|
144
|
+
|
145
|
+
2. Create either a fix branch or a feature branch
|
146
|
+
* `git checkout -b fix-(name-here)`
|
147
|
+
* `git checkout -b feature-(name-here)`
|
148
|
+
|
149
|
+
3. Commit your changes
|
150
|
+
* `git commit -am 'Message describing the fix or feature'`
|
151
|
+
|
152
|
+
4. Push the branch into your repo
|
153
|
+
* `git push origin feature-(name-here)`
|
154
|
+
|
155
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/clivers.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'clivers/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "clivers"
|
8
|
+
spec.version = Clivers::VERSION
|
9
|
+
spec.authors = ["Matthieu Vachon"]
|
10
|
+
spec.email = ["matthieu.o.vachon@gmail.com"]
|
11
|
+
spec.description = "Command line tool versions manager"
|
12
|
+
spec.summary = <<-EOS
|
13
|
+
This gem has been built to ease switching multiple versions
|
14
|
+
of command line tools like Ruby, Python, Notepad++, etc. It
|
15
|
+
is not installer, it's a tool to switch already installed
|
16
|
+
software.
|
17
|
+
|
18
|
+
By using a configuration file and some conventions, the
|
19
|
+
tool will be able to locate your program and switch
|
20
|
+
between multiple version of the same command line tool by
|
21
|
+
tweaking the environment variables, usually simply the
|
22
|
+
PATH one.
|
23
|
+
EOS
|
24
|
+
spec.homepage = "https://github.com/maoueh/clivers"
|
25
|
+
spec.license = "MIT"
|
26
|
+
|
27
|
+
spec.files = `git ls-files`.split($/) - [".gitattributes", ".gitignore"]
|
28
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
29
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
spec.add_dependency "nugrant", "~>1.1.0"
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
35
|
+
spec.add_development_dependency "rake"
|
36
|
+
end
|
data/lib/clivers.rb
ADDED
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: clivers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.dev1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthieu Vachon
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nugrant
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Command line tool versions manager
|
56
|
+
email:
|
57
|
+
- matthieu.o.vachon@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- .buildpath
|
63
|
+
- .project
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- clivers.gemspec
|
69
|
+
- lib/clivers.rb
|
70
|
+
- lib/clivers/version.rb
|
71
|
+
homepage: https://github.com/maoueh/clivers
|
72
|
+
licenses:
|
73
|
+
- MIT
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ! '>'
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.3.1
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.0.3
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: This gem has been built to ease switching multiple versions of command line
|
95
|
+
tools like Ruby, Python, Notepad++, etc. It is not installer, it's a tool to switch
|
96
|
+
already installed software. By using a configuration file and some conventions,
|
97
|
+
the tool will be able to locate your program and switch between multiple version
|
98
|
+
of the same command line tool by tweaking the environment variables, usually simply
|
99
|
+
the PATH one.
|
100
|
+
test_files: []
|