├── CONTRIBUTING ├── LICENSE ├── README.md ├── bin └── gs └── gs.gemspec /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | This code tries to solve a particular problem with a very simple 2 | implementation. We try to keep the code to a minimum while making 3 | it as clear as possible. The design is very likely finished, and 4 | if some feature is missing it is possible that it was left out on 5 | purpose. That said, new usage patterns may arise, and when that 6 | happens we are ready to adapt if necessary. 7 | 8 | A good first step for contributing is to meet us on IRC and discuss 9 | ideas. We spend a lot of time on #lesscode at freenode, always ready 10 | to talk about code and simplicity. If connecting to IRC is not an 11 | option, you can create an issue explaining the proposed change and 12 | a use case. We pay a lot of attention to use cases, because our 13 | goal is to keep the code base simple. Usually the result of a 14 | conversation is the creation of a different tool. 15 | 16 | Please don't start the conversation with a pull request. The code 17 | should come at last, and even though it may help to convey an idea, 18 | more often than not it draws the attention to a particular 19 | implementation. 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 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. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 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). The other tool showcased in the 17 | screencast is [dep](http://twpil.github.com/dep/), a dependency 18 | tracker. 19 | 20 | ## Usage 21 | 22 | This library provides a command line application called `gs`. These 23 | are the available options: 24 | 25 | ### gs init 26 | 27 | Creates the $PWD/.gs directory. 28 | 29 | ### gs help 30 | 31 | Displays the documentation. 32 | 33 | ### gs [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 gs 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 gs 49 | 50 | Next, type `gs init` within your project and then just `gs` 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 `gs`. 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. 70 | -------------------------------------------------------------------------------- /bin/gs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | help = < 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 `gs help`." 50 | exit 1 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /gs.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "gs" 3 | s.version = "0.2.0" 4 | s.summary = "Gemset management" 5 | s.description = "Gemset management" 6 | s.authors = ["Michel Martens"] 7 | s.email = ["soveran@gmail.com"] 8 | s.homepage = "http://soveran.github.com/gs" 9 | s.files = ["README.md", "LICENSE", "bin/gs"] 10 | s.license = "MIT" 11 | 12 | s.executables.push("gs") 13 | end 14 | --------------------------------------------------------------------------------