Class: OS::Mac::SDKLocator

Inherits:
Object
  • Object
show all
Defined in:
Library/Homebrew/os/mac/sdk.rb

Defined Under Namespace

Classes: NoSDKError

Instance Method Summary collapse

Instance Method Details

#latest_sdkObject



24
25
26
27
28
29
# File 'Library/Homebrew/os/mac/sdk.rb', line 24

def latest_sdk
  return if sdk_paths.empty?

  v, path = sdk_paths.max { |a, b| OS::Mac::Version.new(a[0]) <=> OS::Mac::Version.new(b[0]) }
  SDK.new v, path
end

#sdk_for(v) ⇒ Object

Raises:



17
18
19
20
21
22
# File 'Library/Homebrew/os/mac/sdk.rb', line 17

def sdk_for(v)
  path = sdk_paths[v]
  raise NoSDKError if path.nil?

  SDK.new v, path
end