gemset 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +19 -0
  3. data/README.md +69 -0
  4. data/bin/gemset +52 -0
  5. metadata +48 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 94359be31692bc3e774ed53fa3842376eddb5e12
4
+ data.tar.gz: 3336ba460b91e838e9dcc21ae1784ed9ca58997a
5
+ SHA512:
6
+ metadata.gz: f54c2d779d56ecfd2bc4ee5847044ba191bffcd05bcf0a7580bcf2e152ee3235c92400d6354bf44d9d6c272f34bc9e156297405f0997bbce9285e814c067377f
7
+ data.tar.gz: b3f38eed0d63656adcd3f79ded5aa057da3740f6e9e524cc5dec95d5b947f1831dce9ab5898fc96949fa341a942056d6e0a56356783be0f73207a772f0171a1b
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2012-2015 Michel Martens
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,69 @@
1
+ # Make your life easier with gemsets
2
+
3
+ We have all become familiar with the concept of gemsets. They
4
+ come in different shapes and sizes, and provide isolation
5
+ for project dependencies. Some of the libraries that
6
+ implement gemsets are [rip](https://github.com/defunkt/rip),
7
+ [RVM](https://rvm.beginrescueend.com/gemsets/) and
8
+ [rbenv-gemset](https://github.com/jamis/rbenv-gemset).
9
+
10
+ This library recreates the absolutely minimal feature set for creating
11
+ and using gemsets.
12
+
13
+ ## Introductory screencast
14
+
15
+ If you want to see this workflow in action, [check the introductory
16
+ video](http://vimeo.com/soveran/gs). Note that this tool was renamed
17
+ to `gemset`. The other tool showcased in the screencast is
18
+ [dep](http://twpil.github.com/dep/), a dependency tracker.
19
+
20
+ ## Usage
21
+
22
+ This library provides a command line application called `gemset`. These
23
+ are the available options:
24
+
25
+ ### gemset init
26
+
27
+ Creates the $PWD/.gs directory.
28
+
29
+ ### gemset help
30
+
31
+ Displays the documentation.
32
+
33
+ ### gemset [command]
34
+
35
+ When called with no arguments, it starts a shell session and
36
+ configures the variables GEM_HOME, GEM_PATH and PATH to point to the
37
+ $PWD/.gs directory. In addition, it sets the GS_NAME variable with the
38
+ name of the current gemset (useful for PS1).
39
+
40
+ When called with arguments other than init or help, it will execute
41
+ command in a gemset shell session and return to the parent session once
42
+ finished.
43
+
44
+ ## Getting started
45
+
46
+ First, grab the gem:
47
+
48
+ $ gem install gemset
49
+
50
+ Next, type `gemset init` within your project and then just `gemset` to start
51
+ the subshell. The environment variables used by RubyGems will now
52
+ point to the `.gs` directory, and every gem you install, every gem you
53
+ remove, will use that path.
54
+
55
+ ### Alternatives
56
+
57
+ There are some tools that provide a similar functionality and can
58
+ be used as a drop in replacement for `gemset`. Here are two
59
+ outstanding alternatives:
60
+
61
+ #### [gst](https://github.com/tonchis/gst)
62
+
63
+ This is a bash implementation that modifies the existing
64
+ environment instead of creating a subshell.
65
+
66
+ #### [bs](https://github.com/educabilia/bs)
67
+
68
+ This is a manager for environment variables written in bash. It
69
+ takes a different and very interesting approach.
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ help = <<EOS
4
+ GEMSET(1)
5
+
6
+ NAME
7
+ gemset -- Gemset management
8
+
9
+ SYNOPSIS
10
+ gemset init
11
+ gemset help
12
+ gemset [command]
13
+
14
+ DESCRIPTION
15
+ When called with no arguments, it starts a shell session and
16
+ configures the variables GEM_HOME, GEM_PATH and PATH to point
17
+ to the $PWD/.gs directory. In addition, it sets the GS_NAME
18
+ variable with the name of the current gemset (useful for PS1).
19
+
20
+ init
21
+ Creates the $PWD/.gs directory.
22
+
23
+ help
24
+ Displays this message.
25
+
26
+ [command]
27
+ An optional command that will be executed under gemset shell
28
+ session and return to the caller session once finished.
29
+ EOS
30
+
31
+ case ARGV[0]
32
+ when "init" then Dir.mkdir(".gs"); exec($0)
33
+ when "help" then puts help
34
+ else
35
+ if File.directory?(".gs")
36
+ pwd = Dir.pwd
37
+ env = ENV.to_hash
38
+ env["GS_NAME"] = File.basename(pwd)
39
+ env["GEM_HOME"] = pwd + "/.gs"
40
+ env["GEM_PATH"] = pwd + "/.gs:#{`gem env path`.strip}"
41
+ env["PATH"] = pwd + "/.gs/bin:#{ENV['PATH']}"
42
+
43
+ if ARGV.length > 0
44
+ exec env, *ARGV
45
+ else
46
+ exec env, ENV["SHELL"] || ENV["COMSPEC"]
47
+ end
48
+ else
49
+ puts "Directory .gs not found. Try `gemset help`."
50
+ exit 1
51
+ end
52
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gemset
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Michel Martens
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Gemset management
14
+ email:
15
+ - soveran@gmail.com
16
+ executables:
17
+ - gemset
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README.md
22
+ - LICENSE
23
+ - bin/gemset
24
+ homepage: http://soveran.github.com/gs
25
+ licenses:
26
+ - MIT
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 2.0.14
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: Gemset management
48
+ test_files: []