brew/Library/Homebrew/extend/os/linux/simulate_system.rb
Issy Long 0e81efcccb
sorbet: Comment more files that can't be strict because of undef
- 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.
2024-08-09 18:23:00 +01:00

30 lines
630 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 os
undef simulating_or_running_on_linux?
undef current_os
sig { returns(T.nilable(Symbol)) }
def os
return :macos if @os.blank? && Homebrew::EnvConfig.simulate_macos_on_linux?
@os
end
sig { returns(T::Boolean) }
def simulating_or_running_on_linux?
os.blank? || os == :linux
end
sig { returns(Symbol) }
def current_os
os || :linux
end
end
end
end