Top Level Namespace

Constant Summary collapse

CURRENT_RVM_RUBY =
ARGV[0]
CURRENT_RVM_GEMSET =
ARGV[1] || 'default'
CURRENT_RVM =
current_rvm
RVM_COMMAND_PREFIX =
<<~SHELL_SCRIPT
  # Load RVM into a shell session *as a function*
  if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
    # First try to load from a user install
    source "$HOME/.rvm/scripts/rvm"
  elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
    # Then try to load from a root install
    source "/usr/local/rvm/scripts/rvm"
  else
    printf "ERROR: An RVM installation was not found.\\n"
  fi
  rvm use #{CURRENT_RVM_RUBY}@#{CURRENT_RVM_GEMSET}
SHELL_SCRIPT

Instance Method Summary collapse

Instance Method Details

#rvm_command(command) ⇒ Object



42
43
44
# File 'lib/rvm-tui.rb', line 42

def rvm_command(command)
  `bash -c '#{RVM_COMMAND_PREFIX}\n#{command}'`
end