Universally apply Ruby disable options

This commit is contained in:
Bo Anderson 2022-11-05 01:58:12 +00:00
parent 31d4da3380
commit 7d7083d0f3
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
4 changed files with 5 additions and 3 deletions

View File

@ -724,7 +724,7 @@ then
fi
# Disable Ruby options we don't need.
RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt"
export HOMEBREW_RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt"
if [[ -z "${HOMEBREW_RUBY_WARNINGS}" ]]
then
@ -839,7 +839,7 @@ else
# shellcheck disable=SC2154
{
auto-update "$@"
exec "${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_WARNINGS}" "${RUBY_DISABLE_OPTIONS}" \
exec "${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_WARNINGS}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" \
"${HOMEBREW_LIBRARY}/Homebrew/brew.rb" "$@"
}
fi

View File

@ -11,7 +11,7 @@ homebrew-rubocop() {
source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh"
setup-ruby-path
GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${RUBY_DISABLE_OPTIONS}" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
GEM_VERSION="$("${HOMEBREW_RUBY_PATH}" "${HOMEBREW_RUBY_DISABLE_OPTIONS}" -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')"
GEM_HOME="${HOMEBREW_LIBRARY}/Homebrew/vendor/bundle/ruby/${GEM_VERSION}"
BUNDLE_GEMFILE="${HOMEBREW_LIBRARY}/Homebrew/Gemfile"

View File

@ -52,4 +52,5 @@ end.freeze
HOMEBREW_RUBY_EXEC_ARGS = [
RUBY_PATH,
ENV.fetch("HOMEBREW_RUBY_WARNINGS"),
ENV.fetch("HOMEBREW_RUBY_DISABLE_OPTIONS"),
].freeze

View File

@ -36,6 +36,7 @@ HOMEBREW_TEMP = (HOMEBREW_PREFIX.parent/"temp").freeze
HOMEBREW_RUBY_EXEC_ARGS = [
RUBY_PATH,
ENV.fetch("HOMEBREW_RUBY_WARNINGS"),
ENV.fetch("HOMEBREW_RUBY_DISABLE_OPTIONS"),
"-I", HOMEBREW_LIBRARY_PATH/"test/support/lib"
].freeze