Class: Homebrew::SimulateSystem Private

Inherits:
Object
  • Object
show all
Defined in:
simulate_system.rb,
extend/os/mac/simulate_system.rb,
extend/os/linux/simulate_system.rb

Overview

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

Helper module for simulating different system condfigurations.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.archObject

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.



12
13
14
# File 'simulate_system.rb', line 12

def arch
  @arch
end

.osSymbol?

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:



12
13
14
15
16
# File 'extend/os/linux/simulate_system.rb', line 12

def os
  return :macos if @os.blank? && Homebrew::EnvConfig.simulate_macos_on_linux?

  @os
end

Class Method Details

.clearvoid

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.

This method returns an undefined value.



30
31
32
# File 'simulate_system.rb', line 30

def clear
  @os = @arch = nil
end

.current_archSymbol

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:



45
46
47
# File 'simulate_system.rb', line 45

def current_arch
  @arch || Hardware::CPU.type
end

.current_osSymbol

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:



16
17
18
# File 'extend/os/mac/simulate_system.rb', line 16

def current_os
  os || MacOS.version.to_sym
end

.simulating_or_running_on_linux?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)


19
20
21
# File 'extend/os/linux/simulate_system.rb', line 19

def simulating_or_running_on_linux?
  os.blank? || os == :linux
end

.simulating_or_running_on_macos?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)


11
12
13
# File 'extend/os/mac/simulate_system.rb', line 11

def simulating_or_running_on_macos?
  os.blank? || [:macos, *MacOSVersions::SYMBOLS.keys].include?(os)
end