Unverified Commit b80edb18 authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

💅 Tidy up ruby-build help output

parent 91c95bbf
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -2,27 +2,27 @@
#
# Summary: Install a Ruby version using ruby-build
#
# Usage: rbenv install [-f|-s] [-kpv] <version>
# Usage: rbenv install [-f|-s] [-kpv] <version> [-- <configure-args...>]
#        rbenv install [-f|-s] [-kpv] <definition-file>
#        rbenv install -l|--list
#        rbenv install --list
#        rbenv install --version
#
#   -l/--list          List latest stable versions for each Ruby
#   -L/--list-all      List all local versions
#   -f/--force         Install even if the version appears to be installed already
#   -s/--skip-existing Skip if the version appears to be installed already
#   -l, --list           List latest stable versions for each Ruby
#   -L, --list-all       List all local versions, including outdated ones
#   -f, --force          Allow overwriting an existing installed version
#   -s, --skip-existing  Avoid overwriting an existing installed version
#
#   ruby-build options:
#
#   -k/--keep          Keep source tree in $RBENV_BUILD_ROOT after installation
#                      (defaults to $RBENV_ROOT/sources)
#   -p/--patch         Apply a patch from stdin before building
#   -v/--verbose       Verbose mode: print compilation status to stdout
#   -v, --verbose   Verbose mode: forward all build output to stdout/stderr
#   -p, --patch     Apply a patch from stdin before building
#   -k, --keep      Keep source tree in RBENV_BUILD_ROOT after installation
#                   (defaults to "RBENV_ROOT/sources")
#   --version       Show version of ruby-build
#
# For detailed information on installing Ruby versions with
# ruby-build, including a list of environment variables for adjusting
# compilation, see: https://github.com/rbenv/ruby-build#usage
# For detailed information on installing Ruby versions with ruby-build,
# including a list of environment variables for adjusting compilation,
# see: https://github.com/rbenv/ruby-build#usage
#
set -e
[ -n "$RBENV_DEBUG" ] && set -x
@@ -100,7 +100,7 @@ for option in "${OPTIONS[@]}"; do
    [ ! -t 1 ] || {
      echo
      echo "Only latest stable releases for each Ruby implementation are shown."
      echo "Use 'rbenv install --list-all / -L' to show all local versions."
      echo "Use \`rbenv install --list-all' to show all local versions."
    } 1>&2
    exit
    ;;
@@ -239,7 +239,7 @@ if [ "$STATUS" == "2" ]; then
      echo "$candidates" | indent
    fi
    echo
    echo "See all available versions with \`rbenv install --list'."
    echo "See all available versions with \`rbenv install --list-all'."
    echo
    echo -n "If the version you need is missing, try upgrading ruby-build"
    if [ "$here" != "${here#"$(brew --prefix 2>/dev/null)"}" ]; then
@@ -247,7 +247,7 @@ if [ "$STATUS" == "2" ]; then
      echo "  brew upgrade ruby-build"
    elif [ -d "${here}/.git" ]; then
      printf ":\n\n"
      echo "  git -C ${here} pull"
      echo "  git -C ${here/${HOME}\//~/} pull"
    else
      printf ".\n"
    fi
+11 −10
Original line number Diff line number Diff line
#!/usr/bin/env bash
#
# Usage: ruby-build [-kpv] <definition> <prefix>
#        ruby-build --definitions
# Usage: ruby-build [-kpv] <definition> <prefix> [-- <configure-args...>]
#        ruby-build {--list|--definitions}
#        ruby-build --version
#
#   -k/--keep        Do not remove source tree after installation
#   -p/--patch       Apply a patch from stdin before building
#   -v/--verbose     Verbose mode: print compilation status to stdout
#   -4/--ipv4        Resolve names to IPv4 addresses only
#   -6/--ipv6        Resolve names to IPv6 addresses only
#   --definitions    List all local definitions
#   -l/--list        List latest stable releases for each Ruby
#   -l, --list      List latest stable releases for each Ruby
#   --definitions   List all local definitions, including outdated ones
#   --version       Show version of ruby-build
#
#   -v, --verbose   Verbose mode: forward all build output to stdout/stderr
#   -p, --patch     Apply a patch from stdin before building
#   -k, --keep      Do not remove source tree after installation
#   -4, --ipv4      Resolve names to IPv4 addresses only
#   -6, --ipv6      Resolve names to IPv6 addresses only
#

RUBY_BUILD_VERSION="20231025"

+3 −3
Original line number Diff line number Diff line
@@ -101,11 +101,11 @@ The following versions contain \`1.9.3' in the name:
  1.9.3-p0
  1.9.3-p194

See all available versions with \`rbenv install --list'.
See all available versions with \`rbenv install --list-all'.

If the version you need is missing, try upgrading ruby-build:

  git -C ${BATS_TEST_DIRNAME}/.. pull
  git -C ${BATS_TEST_DIRNAME/$HOME\//~/}/.. pull
OUT

  unstub brew
@@ -122,7 +122,7 @@ OUT
  assert_output <<OUT
ERROR

See all available versions with \`rbenv install --list'.
See all available versions with \`rbenv install --list-all'.

If the version you need is missing, try upgrading ruby-build: