Sha256: 4f2f13f5563f1cf8e4a341e75fee7e62c03e398522876f1d04e8ef72ffe30544

Contents?: true

Size: 1.11 KB

Versions: 16

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env bash

source "$rvm_path/scripts/base"

usage()
{
  echo "Usage: rvm tools {identifier,path-identifier,strings}" 1>&2
  exit 1
}

# Return the identifier that's current in use.
tools_identifier()
{
  __rvm_environment_identifier
}

tools_path_identifier()
{
  if [[ -z "$1" || ! -d "$1" ]]; then
    echo "Usage: rvm tools path-identifier 'path-to-check'"
    return 1
  fi

  source "$rvm_path/scripts/rvm"
  builtin cd "$1"
  rvm_promptless=1 __rvm_project_rvmrc
  rvmrc_result="$?"
  __rvm_environment_identifier
  exit $rvmrc_result
}

tools_strings()
{
  for ruby_name in "$@"; do
    __rvm_unset_ruby_variables
    rvm_ruby_string="$ruby_name"
    if { __rvm_ruby_string && __rvm_select; } >/dev/null 2>&1; then
      basename "$rvm_ruby_gem_home"
    else
      echo ""
    fi
  done
}

args=($*)
action="${args[0]}"
args="$(echo ${args[@]:1})" # Strip trailing / leading / extra spacing.

[[ -z "$action" ]] && usage

case "$action" in
  identifier)      tools_identifier ;;
  path-identifier) tools_path_identifier "$args" ;;
  strings)         tools_strings "$args" ;;
  *)               usage ;;
esac

exit $?

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
rvm-1.0.21 scripts/tools
rvm-1.0.20 scripts/tools
rvm-1.0.19 scripts/tools
rvm-1.0.18 scripts/tools
rvm-1.0.17 scripts/tools
rvm-1.0.15 scripts/tools
gemrage-1.0.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.4.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.4.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.3.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.3.1 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.3.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.2.0 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
gemrage-0.1.2 vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools
rvm-1.0.14 scripts/tools
rvm-1.0.13 scripts/tools