brew/Library/Homebrew/extend/os/mac/simulate_system.rb

22 lines
443 B
Ruby
Raw Normal View History

2022-11-21 21:04:22 -08:00
# typed: true
# 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)
2022-11-21 21:04:22 -08:00
end
sig { returns(Symbol) }
def current_os
os || MacOS.version.to_sym
end
end
end
end