gem_home
gem_home copied to clipboard
Optional auto-switching
This commit provides the same workflow as chruby's auto.sh. When
auto.sh script loaded into environment, it makes gem_home to
automatically use a .ruby-gemhome to get project's $GEM_HOME path
(.ruby-gemhome filename is customizable by the $GEM_HOME_FILENAME
variable).
One major problem with this is that you cannot have multiple traps on bash. It's also very difficult to get the current trap command and append to it.
@postmodern Would it be possible to detect the chruby auto switching here and set up a trap that does both things? Likewise in chruby's auto we could detect the gem_home auto behavior and set up the trap.
if bash
if $USING_CHRUBY_AUTO
trap gem_home and chruby stuff
else
trap gem_home stuff
end
end