diff --git a/README.md b/README.md index 6d3f54ea..a5cfb9bd 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ List supported Rubies and their current stable versions: Updates then list the supported Rubies and their current stable versions: - $ ruby-install --latest + $ ruby-install --update Install the current stable version of Ruby: @@ -65,7 +65,7 @@ Install the current stable version of Ruby: Install the latest version of Ruby: - $ ruby-install --latest ruby + $ ruby-install --update ruby Install a stable version of Ruby: diff --git a/doc/man/ruby-install.1.md b/doc/man/ruby-install.1.md index 7f1a8733..f8e0a7be 100644 --- a/doc/man/ruby-install.1.md +++ b/doc/man/ruby-install.1.md @@ -92,7 +92,7 @@ https://github.com/postmodern/ruby-install#readme `--no-reinstall` Skip installation if another Ruby is detected in same location. -`-L`, `--latest` +`-U`, `--update` Downloads the latest ruby versions and checksums from the ruby-versions repository (https://github.com/postmodern/ruby-versions#readme). diff --git a/share/man/man1/ruby-install.1 b/share/man/man1/ruby-install.1 index 140826c5..d76bf1c0 100644 --- a/share/man/man1/ruby-install.1 +++ b/share/man/man1/ruby-install.1 @@ -121,7 +121,7 @@ Do not install build dependencies before installing Ruby\. Skip installation if another Ruby is detected in same location\. .LP .TP -\fB-L\fR, \fB--latest\fR +\fB-U\fR, \fB--update\fR Downloads the latest ruby versions and checksums from the ruby\-versions repository (https:\[sl]\[sl]github\.com\[sl]postmodern\[sl]ruby\-versions\[sh]readme)\. .LP diff --git a/share/ruby-install/ruby-install.sh b/share/ruby-install/ruby-install.sh index 118b8ced..72ff6acf 100644 --- a/share/ruby-install/ruby-install.sh +++ b/share/ruby-install/ruby-install.sh @@ -191,7 +191,7 @@ function parse_options() shift ;; -L|--latest) - warn "deprecation: -L,--latest is deprecated. Please use -U,--update instead." + warn "DEPRECATION: -L,--latest is deprecated. Please use -U,--update instead." force_update=1 shift ;; diff --git a/test/ruby-install-tests/parse_options_test.sh b/test/ruby-install-tests/parse_options_test.sh index 0ad316ce..63a8ca77 100755 --- a/test/ruby-install-tests/parse_options_test.sh +++ b/test/ruby-install-tests/parse_options_test.sh @@ -236,6 +236,27 @@ function test_parse_options_with_no_reinstall() assertEquals "did not set to \$no_reinstall" 1 $no_reinstall } +function test_parse_options_with_latest() +{ + parse_options "--latest" "ruby" 2>/dev/null + + assertEquals "did not set to \$force_update" 1 $force_update +} + +function test_parse_option_with_latest_deprecation_warning() +{ + local output="$(parse_options "--latest" "ruby" 2>&1)" + + assertEquals "*** DEPRECATION: -L,--latest is deprecated. Please use -U,--update instead." "$output" +} + +function test_parse_options_with_update() +{ + parse_options "--update" "ruby" 2>/dev/null + + assertEquals "did not set to \$force_update" 1 $force_update +} + function test_parse_options_with_additional_options() { local expected=(--enable-shared CFLAGS="-03")