···11-function rvm --description='Ruby enVironment Manager'
22- # run RVM and capture the resulting environment
33- set --local env_file (mktemp -t rvm.fish.XXXXXXXXXX)
44- # This finds where RVM's root directory is and sources scripts/rvm from within it. Then loads RVM in a clean environment and dumps the environment variables it generates out for us to use.
55- bash -c 'PATH=$GEM_HOME/bin:$PATH;RVMA='~/.rvm/bin/rvm';source $(echo $RVMA | sed "s/\/bin\//\/scripts\//"); rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
66-77- # apply rvm_* and *PATH variables from the captured environment
88- and eval (grep -E '^rvm|^PATH|^GEM_PATH|^GEM_HOME' $env_file | grep -v '_clr=' | sed '/^[^=]*PATH/s/:/" "/g; s/^/set -xg /; s/=/ "/; s/$/" ;/; s/(//; s/)//')
99- # needed under fish >= 2.2.0
1010- and set -xg GEM_PATH (echo $GEM_PATH | sed 's/ /:/g')
1111-1212- # clean up
1313- rm -f $env_file
1414-end
1515-1616-function __handle_rvmrc_stuff --on-variable PWD
1717- # Source a .rvmrc file in a directory after changing to it, if it exists.
1818- # To disable this feature, set rvm_project_rvmrc=0 in $HOME/.rvmrc
1919- if test "$rvm_project_rvmrc" != 0
2020- set -l cwd $PWD
2121- while true
2222- if contains $cwd "" $HOME "/"
2323- if test "$rvm_project_rvmrc_default" = 1
2424- rvm default 1>/dev/null 2>&1
2525- end
2626- break
2727- else
2828- if test -e .rvmrc -o -e .ruby-version -o -e .ruby-gemset -o -e Gemfile
2929- eval "rvm reload" > /dev/null
3030- eval "rvm rvmrc load" >/dev/null
3131- break
3232- else
3333- set cwd (dirname "$cwd")
3434- end
3535- end
3636- end
3737-3838- set -e cwd
3939- end
4040-end