Module: OS::Linux::Cleanup Private

Extended by:
T::Helpers
Included in:
Homebrew::Cleanup
Defined in:
extend/os/linux/cleanup.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Instance Method Summary collapse

Instance Method Details

#use_system_ruby?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'extend/os/linux/cleanup.rb', line 12

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