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.
22 lines
505 B
Ruby
22 lines
505 B
Ruby
# typed: true # This cannot be `# typed: strict` due to the use of `undef`.
|
|
# frozen_string_literal: true
|
|
|
|
module Homebrew
|
|
class SimulateSystem
|
|
class << self
|
|
undef simulating_or_running_on_macos?
|
|
undef current_os
|
|
|
|
sig { returns(T::Boolean) }
|
|
def simulating_or_running_on_macos?
|
|
os.blank? || [:macos, *MacOSVersion::SYMBOLS.keys].include?(os)
|
|
end
|
|
|
|
sig { returns(Symbol) }
|
|
def current_os
|
|
os || MacOS.version.to_sym
|
|
end
|
|
end
|
|
end
|
|
end
|