fix.sh in checkoff-0.19.2 vs fix.sh in checkoff-0.20.0
- old
+ new
@@ -67,11 +67,22 @@
ensure_ruby_build
}
latest_ruby_version() {
major_minor=${1}
- rbenv install --list 2>/dev/null | grep "^${major_minor}."
+
+ # Double check that this command doesn't error out under -e
+ rbenv install --list >/dev/null 2>&1
+
+ # not sure why, but 'rbenv install --list' below exits with error code
+ # 1...after providing the same output the previous line gave when it
+ # exited with error code 0.
+ #
+ # https://github.com/rbenv/rbenv/issues/1441
+ set +e
+ rbenv install --list 2>/dev/null | cat | grep "^${major_minor}."
+ set -e
}
ensure_dev_library() {
header_file_name=${1:?header file name}
homebrew_package=${2:?homebrew package}
@@ -89,15 +100,23 @@
ensure_dev_library readline/readline.h readline libreadline-dev
ensure_dev_library zlib.h zlib zlib1g-dev
ensure_dev_library openssl/ssl.h openssl libssl-dev
}
+ensure_latest_ruby_build_definitions() {
+ ensure_rbenv
+
+ git -C "$(rbenv root)"/plugins/ruby-build pull
+}
+
# You can find out which feature versions are still supported / have
# been release here: https://www.ruby-lang.org/en/downloads/
ensure_ruby_versions() {
+ ensure_latest_ruby_build_definitions
+
# You can find out which feature versions are still supported / have
# been release here: https://www.ruby-lang.org/en/downloads/
- ruby_versions="$(latest_ruby_version 2.6)"
+ ruby_versions="$(latest_ruby_version 2.7)"
echo "Latest Ruby versions: ${ruby_versions}"
ensure_ruby_build_requirements