Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 2.32 KB

README.md

File metadata and controls

92 lines (66 loc) · 2.32 KB

gem_home

Changes your $GEM_HOME in fish shell

Inspiration

postmodern gem_home for Bash and ZSH

Features

  • Updates $GEM_HOME, $GEM_PATH and $PATH.
    • Switches $GEM_HOME by pushing and popping gem directories to $GEM_PATH. This allows the stacking of multiple gem directories.
    • Prepends the new $GEM_HOME/bin to $PATH so it takes precedence.
  • Compartmentalizes gems into .gem/$ruby_engine/$ruby_version.
  • Plays nicely with RVM and chruby.
  • For fish shell

Synopsis

Change the $GEM_HOME:

$ gem_home /path/to/project

Revert the $GEM_HOME:

$ gem_home -

Using with bundler:

$ cd padrino-app/
$ gem_home .
$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.0
Using thread_safe 0.3.4
Installing tzinfo 1.2.2
Using activesupport 4.1.4
Using addressable 2.3.6
Installing builder 3.2.2
Using bundler 1.6.2
Using data_objects 0.10.14
Using dm-core 1.2.1
Using dm-aggregates 1.2.0
Using dm-do-adapter 1.2.0
Using dm-migrations 1.2.0
...    
$ padrino console # no `bundle exec` needed
  • Notice how bundler re-used many of the gems from ~/.gem/... but installed missing gems into $PWD/.gem/....

Install

wget -O gem_home-0.1.2.tar.gz https://github.com/rjkaes/gem_home/archive/v0.1.2.tar.gz
tar -xzvf gem_home-0.1.2.tar.gz
cd gem_home-0.1.2/
sudo make install

PGP

All releases are PGP signed for security. To verify that a release was not tampered with:

wget https://raw.github.com/rjkaes/gem_home/master/pkg/gem_home-0.1.2.tar.gz.asc
gpg --verify gem_home-0.1.2.tar.gz.asc gem_home-0.1.2.tar.gz

Configuration

Add the following to your ~/.config/fish/config.fish:

source /usr/local/share/gem_home/gem_home.fish

Alternatives