mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

- Found with `grep -rL "# typed: strict" Library/Homebrew | xargs grep -l "undef "`. - This stops people from trying to bump them and getting an error that they can't fix because [it's a Sorbet limitation](https://sorbet.org/docs/error-reference#3008), wasting contributor time.
23 lines
726 B
Ruby
23 lines
726 B
Ruby
# typed: true # This cannot be `# typed: strict` due to the use of `undef`.
|
|
# frozen_string_literal: true
|
|
|
|
module Homebrew
|
|
class Cleanup
|
|
undef use_system_ruby?
|
|
|
|
def use_system_ruby?
|
|
return false if Homebrew::EnvConfig.force_vendor_ruby?
|
|
|
|
rubies = [which("ruby"), which("ruby", ORIGINAL_PATHS)].compact
|
|
system_ruby = Pathname.new("/usr/bin/ruby")
|
|
rubies << system_ruby if system_ruby.exist?
|
|
|
|
check_ruby_version = HOMEBREW_LIBRARY_PATH/"utils/ruby_check_version_script.rb"
|
|
rubies.uniq.any? do |ruby|
|
|
quiet_system ruby, "--enable-frozen-string-literal", "--disable=gems,did_you_mean,rubyopt",
|
|
check_ruby_version, RUBY_VERSION
|
|
end
|
|
end
|
|
end
|
|
end
|